Skip to content

Commit d09a0bd

Browse files
authored
Merge pull request #97 from bobleesj/CI
Use latest GitHub Actions CI files from cookiecutter
2 parents 6b441ad + 775cb4f commit d09a0bd

File tree

5 files changed

+101
-86
lines changed

5 files changed

+101
-86
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+
coverage:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out diffpy.utils
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.utils 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.utils
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 & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
1-
name: Build Documentation
1+
name: Build and Deploy Documentation
22

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

913
jobs:
10-
test:
14+
docs:
1115
runs-on: ubuntu-latest
12-
defaults:
13-
run:
14-
shell: bash -l {0}
1516
steps:
16-
- uses: actions/checkout@v3
17-
with:
18-
fetch-depth: 0
17+
- name: Check out diffpy.utils
18+
uses: actions/checkout@v4
1919

20-
- uses: conda-incubator/setup-miniconda@v2
20+
- name: Initialize miniconda
21+
uses: conda-incubator/setup-miniconda@v3
2122
with:
2223
activate-environment: build
2324
auto-update-conda: true
25+
environment-file: environment.yml
26+
auto-activate-base: false
2427

25-
- name: install requirements
28+
- name: Conda config
2629
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
30+
conda config --set always_yes yes
31+
--set changeps1 no
3232
33-
- name: install the package
34-
run: python -m pip install . --no-deps
33+
- name: Install diffpy.utils 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
3540
3641
- name: build documents
3742
run: make -C doc html
3843

3944
- name: Deploy
40-
uses: peaceiris/actions-gh-pages@v3
45+
uses: peaceiris/actions-gh-pages@v4
4146
with:
4247
github_token: ${{ secrets.GITHUB_TOKEN }}
4348
publish_dir: ./doc/build/html

.github/workflows/main.yml

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +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: Miniconda ${{ matrix.os }}
14-
runs-on: ${{ matrix.os }}
15-
strategy:
16-
matrix:
17-
os: ["ubuntu-latest"]
15+
validate:
16+
runs-on: ubuntu-latest
1817
steps:
19-
- name: check out diffpy.utils
20-
uses: actions/checkout@v3
21-
with:
22-
repository: diffpy/diffpy.utils
23-
path: .
24-
fetch-depth: 0 # avoid shallow clone with no tags
18+
- name: Check out diffpy.utils
19+
uses: actions/checkout@v4
2520

26-
- name: initialize miniconda
27-
# this uses a marketplace action that sets up miniconda in a way that makes
28-
# it easier to use. I tried setting it up without this and it was a pain
29-
uses: conda-incubator/setup-miniconda@v2
21+
- name: Initialize miniconda
22+
uses: conda-incubator/setup-miniconda@v3
3023
with:
3124
activate-environment: test
32-
# environment.yml file is needed by this action. Because I don't want
33-
# maintain this but rather maintain the requirements files it just has
34-
# basic things in it like conda and pip
35-
environment-file: ./environment.yml
36-
python-version: 3
25+
auto-update-conda: true
26+
environment-file: environment.yml
3727
auto-activate-base: false
3828

39-
- name: install diffpy.utils requirements
40-
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.utils and requirements
4135
run: |
42-
conda config --set always_yes yes --set changeps1 no
43-
conda config --add channels conda-forge
44-
conda activate test
4536
conda install --file requirements/run.txt
4637
conda install --file requirements/test.txt
47-
pip install .
38+
python -m pip install -r requirements/pip.txt
39+
python -m pip install . --no-deps
4840
4941
- name: Validate diffpy.utils
50-
shell: bash -l {0}
51-
run: |
52-
conda activate test
53-
coverage run run_tests.py
54-
coverage report -m
55-
codecov
42+
run: python -m pytest

requirements/pip.txt

Whitespace-only changes.

tests/testhelpers.py

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

0 commit comments

Comments
 (0)