Skip to content

Commit c41ab2f

Browse files
authored
Merge pull request #90 from Tieqiong/workflow
try new workflow ymls
2 parents c8a2477 + f660310 commit c41ab2f

File tree

4 files changed

+121
-88
lines changed

4 files changed

+121
-88
lines changed

.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+
docs:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out diffpy.structure
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.structure 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.structure
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 & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,47 @@
1-
name: Build Documentation
1+
name: Build and Deploy Documentation
22

33
on:
4-
push:
5-
branches:
6-
- main
74
release:
5+
types:
6+
- prereleased
7+
- published
8+
workflow_dispatch:
9+
10+
defaults:
11+
run:
12+
shell: bash -l {0}
813

914
jobs:
10-
test:
15+
docs:
1116
runs-on: ubuntu-latest
12-
defaults:
13-
run:
14-
shell: bash -l {0}
1517
steps:
16-
- uses: actions/checkout@v3
17-
with:
18-
fetch-depth: 0
18+
- name: Check out diffpy.structure
19+
uses: actions/checkout@v4
1920

20-
- uses: conda-incubator/setup-miniconda@v2
21+
- name: Initialize miniconda
22+
uses: conda-incubator/setup-miniconda@v3
2123
with:
2224
activate-environment: build
2325
auto-update-conda: true
26+
environment-file: environment.yml
27+
auto-activate-base: false
2428

25-
- name: install requirements
29+
- name: Conda config
2630
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
3233
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
3541
3642
- name: build documents
3743
run: make -C doc html
3844

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-
5245
- name: Deploy
5346
uses: peaceiris/actions-gh-pages@v4
5447
with:

.github/workflows/main.yml

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

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Validate using pytest
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
defaults:
11+
run:
12+
shell: bash -l {0}
13+
14+
jobs:
15+
validate:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check out diffpy.structure
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+
29+
- name: Conda config
30+
run: >-
31+
conda config --set always_yes yes
32+
--set changeps1 no
33+
34+
- name: Install diffpy.structure and requirements
35+
run: |
36+
conda install --file requirements/run.txt
37+
conda install --file requirements/test.txt
38+
python -m pip install -r requirements/pip.txt
39+
python -m pip install . --no-deps
40+
41+
- name: Validate diffpy.structure
42+
run: python -m pytest

0 commit comments

Comments
 (0)