Skip to content

Commit 4ecd139

Browse files
authored
Merge pull request #88 from Tieqiong/yml
update .yml files
2 parents 76bf3aa + 86d0c2b commit 4ecd139

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

.github/workflows/docs.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,21 @@ jobs:
3636
- name: build documents
3737
run: make -C doc html
3838

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+
3952
- name: Deploy
40-
uses: peaceiris/actions-gh-pages@v3
53+
uses: peaceiris/actions-gh-pages@v4
4154
with:
4255
github_token: ${{ secrets.GITHUB_TOKEN }}
4356
publish_dir: ./doc/build/html

.github/workflows/main.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,12 @@ jobs:
4444
conda activate test
4545
conda install --file requirements/run.txt
4646
conda install --file requirements/test.txt
47-
pip install -e .
48-
47+
pip install .
48+
4949
- name: Validate diffpy.structure
5050
shell: bash -l {0}
5151
run: |
5252
conda activate test
53-
coverage run -m diffpy.structure.tests.run
53+
coverage run -m pytest -vv -s
5454
coverage report -m
5555
codecov
56-
57-
- name: Upload coverage to Codecov
58-
uses: codecov/codecov-action@v4
59-
env:
60-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/pre-commit.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
pre-commit:
10+
# pull requests are a duplicate of a branch push if within the same repo.
11+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
17+
- uses: pre-commit/[email protected]
18+
with:
19+
extra_args: --all-files

0 commit comments

Comments
 (0)