Skip to content

Commit d4dfba5

Browse files
authored
Merge pull request #8 from 8bitsam/cookie-wkfls
Cookiecutting - added workflows
2 parents 16e8b7d + 782c3c3 commit d4dfba5

File tree

3 files changed

+116
-0
lines changed

3 files changed

+116
-0
lines changed

.github/workflows/docs.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
shell: bash -l {0}
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- uses: conda-incubator/setup-miniconda@v2
21+
with:
22+
activate-environment: build
23+
auto-update-conda: true
24+
25+
- name: install requirements
26+
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
32+
33+
- name: install the package
34+
run: python -m pip install . --no-deps
35+
36+
- name: build documents
37+
run: make -C doc html
38+
39+
- name: Deploy
40+
uses: peaceiris/actions-gh-pages@v4
41+
with:
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
publish_dir: ./doc/build/html

.github/workflows/main.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- CI
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
miniconda:
13+
name: Miniconda ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: ["ubuntu-latest"]
18+
steps:
19+
- name: check out diffpy.fourigui
20+
uses: actions/checkout@v3
21+
with:
22+
repository: diffpy/diffpy.fourigui
23+
path: .
24+
fetch-depth: 0 # avoid shallow clone with no tags
25+
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
30+
with:
31+
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
37+
auto-activate-base: false
38+
39+
- name: install diffpy.fourigui requirements
40+
shell: bash -l {0}
41+
run: |
42+
conda config --set always_yes yes --set changeps1 no
43+
conda config --add channels conda-forge
44+
conda activate test
45+
conda install --file requirements/run.txt
46+
conda install --file requirements/test.txt
47+
pip install .
48+
- name: Validate diffpy.fourigui
49+
shell: bash -l {0}
50+
run: |
51+
conda activate test
52+
coverage run -m pytest -vv -s
53+
coverage report -m
54+
codecov

.github/workflows/pre-commit.yml

+19
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)