|
1 | | -name: Build Documentation |
| 1 | +name: Build and Deploy Documentation |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - main |
7 | 4 | release: |
| 5 | + types: |
| 6 | + - prereleased |
| 7 | + - published |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +defaults: |
| 11 | + run: |
| 12 | + shell: bash -l {0} |
8 | 13 |
|
9 | 14 | jobs: |
10 | | - test: |
| 15 | + docs: |
11 | 16 | runs-on: ubuntu-latest |
12 | | - defaults: |
13 | | - run: |
14 | | - shell: bash -l {0} |
15 | 17 | steps: |
16 | | - - uses: actions/checkout@v3 |
17 | | - with: |
18 | | - fetch-depth: 0 |
| 18 | + - name: Check out diffpy.structure |
| 19 | + uses: actions/checkout@v4 |
19 | 20 |
|
20 | | - - uses: conda-incubator/setup-miniconda@v2 |
| 21 | + - name: Initialize miniconda |
| 22 | + uses: conda-incubator/setup-miniconda@v3 |
21 | 23 | with: |
22 | 24 | activate-environment: build |
23 | 25 | auto-update-conda: true |
| 26 | + environment-file: environment.yml |
| 27 | + auto-activate-base: false |
24 | 28 |
|
25 | | - - name: install requirements |
| 29 | + - name: Conda config |
26 | 30 | run: >- |
27 | | - conda install -n build -c conda-forge |
28 | | - --file requirements/build.txt |
29 | | - --file requirements/run.txt |
30 | | - --file requirements/docs.txt |
31 | | - --quiet --yes |
| 31 | + conda config --set always_yes yes |
| 32 | + --set changeps1 no |
32 | 33 |
|
33 | | - - name: install the package |
34 | | - run: python -m pip install . --no-deps |
| 34 | + - name: Install diffpy.structure and build requirements |
| 35 | + run: | |
| 36 | + conda install --file requirements/build.txt |
| 37 | + conda install --file requirements/run.txt |
| 38 | + conda install --file requirements/docs.txt |
| 39 | + python -m pip install -r requirements/pip.txt |
| 40 | + python -m pip install . --no-deps |
35 | 41 |
|
36 | 42 | - name: build documents |
37 | 43 | run: make -C doc html |
38 | 44 |
|
39 | | - - name: Run tests and upload coverage |
40 | | - shell: bash -l {0} |
41 | | - run: | |
42 | | - conda activate test |
43 | | - coverage run -m pytest -vv -s |
44 | | - coverage report -m |
45 | | - codecov |
46 | | -
|
47 | | - - name: Upload coverage to Codecov |
48 | | - uses: codecov/codecov-action@v4 |
49 | | - env: |
50 | | - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |
51 | | - |
52 | 45 | - name: Deploy |
53 | 46 | uses: peaceiris/actions-gh-pages@v4 |
54 | 47 | with: |
|
0 commit comments