-
Notifications
You must be signed in to change notification settings - Fork 9
105 lines (94 loc) · 3.1 KB
/
CI.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI
on:
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
# Existing codes likely still have "master" as the primary branch
# Both are tracked here to keep legacy and new codes working
push:
branches:
- "*"
- "**"
pull_request:
branches:
- "master"
- "develop"
schedule:
# Nightly tests run on master by default:
# Scheduled workflows run on the latest commit on the default or base branch.
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
- cron: "0 0 * * *"
jobs:
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
condarc: |
channels:
- conda-forge
create-args: >-
python=${{ matrix.python-version }}
- name: Testing Dependencies
shell: bash -l {0}
run: |
python -m pip install -U pytest pytest-cov codecov
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps -vvv
conda list
- name: Run tests
shell: bash -l {0}
run: |
ls -a despasito/equations_of_state/saft/compiled_modules
pytest -vvv --cov=despasito --cov-report=xml --color=yes despasito/tests/
- name: CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
- name: Flake8
shell: bash -l {0}
run: |
python -m flake8 despasito --count --ignore=E741,W503 --max-line-length=92 --show-source --statistics
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
paper-path: paper/paper.md
- name: Upload
uses: actions/upload-artifact@v3
with:
name: paper
path: paper/paper.pdf
# - name: Commit PDF to repository
# uses: EndBug/add-and-commit@v9
# with:
# message: '(auto) Paper PDF Draft'
# add: 'paper/*.pdf'