Skip to content

Commit 05e1daf

Browse files
committed
use latest workflow
1 parent 09cfb42 commit 05e1daf

5 files changed

Lines changed: 147 additions & 86 deletions

File tree

.github/workflows/codecov.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Gather coverage report and upload to codecov
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
types:
9+
- prereleased
10+
- published
11+
workflow_dispatch:
12+
13+
defaults:
14+
run:
15+
shell: bash -l {0}
16+
17+
jobs:
18+
coverage:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out diffpy.pdffit2
22+
uses: actions/checkout@v4
23+
24+
- name: Initialize miniconda
25+
uses: conda-incubator/setup-miniconda@v3
26+
with:
27+
activate-environment: test
28+
auto-update-conda: true
29+
environment-file: environment.yml
30+
auto-activate-base: false
31+
32+
- name: Conda config
33+
run: >-
34+
conda config --set always_yes yes
35+
--set changeps1 no
36+
37+
- name: Install diffpy.pdffit2 and requirements
38+
run: |
39+
conda install --file requirements/run.txt
40+
conda install --file requirements/test.txt
41+
python -m pip install -r requirements/pip.txt
42+
python -m pip install . --no-deps
43+
44+
- name: Validate diffpy.pdffit2
45+
run: |
46+
coverage run -m pytest -vv -s
47+
coverage report -m
48+
codecov
49+
50+
- name: Upload coverage to Codecov
51+
uses: codecov/codecov-action@v4
52+
env:
53+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/docs.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,48 @@
1-
name: Build Documentation
1+
name: Build and Deploy Documentation
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- cookie # to be removed during merge to main
84
release:
5+
types:
6+
- published
7+
workflow_dispatch:
8+
9+
defaults:
10+
run:
11+
shell: bash -l {0}
912

1013
jobs:
11-
test:
14+
docs:
1215
runs-on: ubuntu-latest
13-
defaults:
14-
run:
15-
shell: bash -l {0}
1616
steps:
17-
- uses: actions/checkout@v3
18-
with:
19-
fetch-depth: 0
17+
- name: Check out diffpy.pdffit2
18+
uses: actions/checkout@v4
2019

21-
- uses: conda-incubator/setup-miniconda@v2
20+
- name: Initialize miniconda
21+
uses: conda-incubator/setup-miniconda@v3
2222
with:
2323
activate-environment: build
2424
auto-update-conda: true
25+
environment-file: environment.yml
26+
auto-activate-base: false
2527

26-
- name: install requirements
28+
- name: Conda config
2729
run: >-
28-
conda install -n build -c conda-forge
29-
--file requirements/build.txt
30-
--file requirements/run.txt
31-
--file requirements/docs.txt
32-
--quiet --yes
30+
conda config --set always_yes yes
31+
--set changeps1 no
3332
34-
- name: install the package
35-
run: python -m pip install . --no-deps
33+
- name: Install diffpy.pdffit2 and build requirements
34+
run: |
35+
conda install --file requirements/build.txt
36+
conda install --file requirements/run.txt
37+
conda install --file requirements/docs.txt
38+
python -m pip install -r requirements/pip.txt
39+
python -m pip install . --no-deps
3640
3741
- name: build documents
3842
run: make -C doc html
3943

4044
- name: Deploy
41-
uses: peaceiris/actions-gh-pages@v3
45+
uses: peaceiris/actions-gh-pages@v4
4246
with:
4347
github_token: ${{ secrets.GITHUB_TOKEN }}
4448
publish_dir: ./doc/build/html

.github/workflows/main.yml

Lines changed: 21 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,42 @@
1-
name: CI
1+
name: Test
22

33
on:
44
push:
55
branches:
66
- main
7-
- CI
87
pull_request:
98
workflow_dispatch:
109

10+
defaults:
11+
run:
12+
shell: bash -l {0}
13+
1114
jobs:
12-
miniconda:
13-
name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }}
14-
runs-on: ${{ matrix.os }}
15-
strategy:
16-
matrix:
17-
python-version: ['3.10', '3.11', '3.12']
18-
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
15+
validate:
16+
runs-on: ubuntu-latest
1917
steps:
20-
- name: check out diffpy.pdffit2
21-
uses: actions/checkout@v3
22-
with:
23-
repository: diffpy/diffpy.pdffit2
24-
path: .
25-
fetch-depth: 0 # avoid shallow clone with no tags
18+
- name: Check out diffpy.pdffit2
19+
uses: actions/checkout@v4
2620

27-
- name: initialize miniconda
28-
# this uses a marketplace action that sets up miniconda in a way that makes
29-
# it easier to use. I tried setting it up without this and it was a pain
21+
- name: Initialize miniconda
3022
uses: conda-incubator/setup-miniconda@v3
3123
with:
32-
miniconda-version: "latest"
3324
activate-environment: test
34-
# environment.yml file is needed by this action. Because I don't want
35-
# maintain this but rather maintain the requirements files it just has
36-
# basic things in it like conda and pip
25+
auto-update-conda: true
3726
environment-file: environment.yml
38-
python-version: ${{ matrix.python-version }}
3927
auto-activate-base: false
4028

41-
- name: install diffpy.pdffit2 requirements
42-
shell: bash -l {0}
29+
- name: Conda config
30+
run: >-
31+
conda config --set always_yes yes
32+
--set changeps1 no
33+
34+
- name: Install diffpy.pdffit2 and requirements
4335
run: |
44-
conda config --set always_yes yes --set changeps1 no
45-
conda config --add channels conda-forge
46-
conda activate test
47-
conda install --file requirements/build.txt
4836
conda install --file requirements/run.txt
4937
conda install --file requirements/test.txt
50-
pip install .
51-
- name: Validate diffpy.pdffit2
52-
shell: bash -l {0}
53-
run: |
54-
conda activate test
55-
coverage run src/diffpy/pdffit2/tests/run.py
56-
coverage report -m
57-
codecov
38+
python -m pip install -r requirements/pip.txt
39+
python -m pip install . --no-deps
5840
59-
# Use this after migrating to pytest
60-
# - name: Validate diffpy.pdffit2
61-
# shell: bash -l {0}
62-
# run: |
63-
# conda activate test
64-
# coverage run -m pytest -vv -s
65-
# coverage report -m
66-
# codecov
41+
- name: Validate diffpy.pdffit2
42+
run: python -m pytest

.github/workflows/matrix.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Matrix test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
defaults:
10+
run:
11+
shell: bash -l {0}
12+
13+
jobs:
14+
test:
15+
name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }}
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
python-version: ['3.10', '3.11', '3.12']
20+
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
21+
steps:
22+
- name: check out diffpy.pdffit2
23+
uses: actions/checkout@v4
24+
25+
- name: Initialize miniconda
26+
uses: conda-incubator/setup-miniconda@v3
27+
with:
28+
activate-environment: test
29+
auto-update-conda: true
30+
environment-file: environment.yml
31+
python-version: ${{ matrix.python-version }}
32+
auto-activate-base: false
33+
34+
- name: Conda config
35+
run: >-
36+
conda config --set always_yes yes
37+
--set changeps1 no
38+
39+
- name: Install diffpy.pdffit2 and requirements
40+
run: |
41+
conda install --file requirements/run.txt
42+
conda install --file requirements/test.txt
43+
python -m pip install -r requirements/pip.txt
44+
python -m pip install . --no-deps
45+
46+
- name: Validate diffpy.pdffit2
47+
run: python -m pytest

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)