Skip to content

Commit 154c87a

Browse files
authoredDec 7, 2024··
Merge pull request #109 from bobleesj/use-resuable-doc
Use reusable workflow for test on PR and build doc with Python 3.12
2 parents 979113a + d106c70 commit 154c87a

File tree

2 files changed

+16
-83
lines changed

2 files changed

+16
-83
lines changed
 

‎.github/workflows/publish-docs-on-release.yml

+8-40
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,11 @@ on:
77

88
jobs:
99
docs:
10-
defaults:
11-
run:
12-
shell: bash -l {0}
13-
14-
runs-on: macos-latest
15-
steps:
16-
- name: Check out diffpy.pdffit2
17-
uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0 # Fetches branches and tags
20-
21-
- name: Initialize miniconda
22-
uses: conda-incubator/setup-miniconda@v3
23-
with:
24-
activate-environment: build
25-
auto-update-conda: true
26-
environment-file: environment.yml
27-
auto-activate-base: false
28-
python-version: 3.12
29-
30-
- name: Conda config
31-
run: >-
32-
conda config --set always_yes yes
33-
--set changeps1 no
34-
35-
- name: Install diffpy.pdffit2 and docs requirements
36-
run: |
37-
conda install --file requirements/conda.txt
38-
conda install --file requirements/docs.txt
39-
conda install --file requirements/build.txt
40-
python -m pip install . --no-deps
41-
42-
- name: build documents
43-
run: make -C doc html
44-
45-
- name: Deploy
46-
uses: peaceiris/actions-gh-pages@v4
47-
with:
48-
github_token: ${{ secrets.GITHUB_TOKEN }}
49-
publish_dir: ./doc/build/html
10+
permissions:
11+
contents: write
12+
uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0
13+
with:
14+
project: diffpy.pdffit2
15+
c_extension: true
16+
headless: false
17+
python_version: 3.12

‎.github/workflows/tests-on-pr.yml

+8-43
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,11 @@ on:
99

1010
jobs:
1111
validate:
12-
defaults:
13-
run:
14-
shell: bash -l {0}
15-
16-
runs-on: ubuntu-latest
17-
steps:
18-
- name: Check out diffpy.pdffit2
19-
uses: actions/checkout@v4
20-
21-
- name: Initialize miniconda
22-
uses: conda-incubator/setup-miniconda@v3
23-
with:
24-
activate-environment: test
25-
auto-update-conda: true
26-
environment-file: environment.yml
27-
auto-activate-base: false
28-
python-version: 3.12
29-
30-
- name: Conda config
31-
run: >-
32-
conda config --set always_yes yes
33-
--set changeps1 no
34-
35-
- name: Install diffpy.pdffit2 and requirements
36-
run: |
37-
conda install --file requirements/conda.txt
38-
conda install --file requirements/test.txt
39-
conda install --file requirements/build.txt
40-
python -m pip install . --no-deps
41-
42-
43-
- name: Validate diffpy.pdffit2
44-
run: |
45-
pytest --cov
46-
coverage report -m
47-
codecov
48-
49-
- name: Upload coverage to Codecov
50-
uses: codecov/codecov-action@v4
51-
with:
52-
verbose: true
53-
fail_ci_if_error: true
54-
token: ${{ secrets.CODECOV_TOKEN }}
12+
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
13+
with:
14+
project: diffpy.pdffi2
15+
c_extension: false
16+
headless: true
17+
python_version: 3.12
18+
secrets:
19+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)
Please sign in to comment.