forked from westpa/westpa
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (95 loc) · 3.04 KB
/
test.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
106
107
name: test
on:
push:
branches:
- "westpa2"
- "develop"
pull_request:
branches:
- "westpa2"
- "develop"
schedule:
# Weekly tests run on "westpa2" and "develop" on Thursdays 3:30 PM UTC (which is 10:30/11:30 EST/EDT)
# 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: "30 15 * * 4"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Linting
run: |
pip install pre-commit
pre-commit run --all-files
test:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os: ["ubuntu-latest", "macos-13", "macos-latest"] # macos-13 is x86-64, macos-latest is arm64
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- 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 }}
miniforge-variant: Mambaforge
environment-file: devtools/conda-envs/test_env.yaml
activate-environment: test_env
channel-priority: true
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true
- name: Install package
# conda setup requires this special shell
shell: bash -l {0}
run: |
conda info --all
python -m pip install . -v --no-deps
conda list
- name: Run tests
# conda setup requires this special shell
shell: bash -l {0}
run: |
pytest -v --cov=westpa --cov-report=xml --color=yes tests
- name: CodeCov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-{{ '${{ matrix.os }}' }}-py{{ '${{ matrix.python-version }}' }}
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
install-dev:
strategy:
matrix:
os: ["ubuntu-latest", "macos-13", "macos-latest"] # macos-13 is x86-64, macos-latest is arm64
name: "Verify dev env"
runs-on: "${{ matrix.os }}"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"
- name: "Install HDF5 with brew if macos-arm64"
if: ${{ matrix.os == 'macos-latest' }}
run: "brew install hdf5"
- name: "Install in dev mode"
run: "python -m pip install -e .[dev]"
- name: "Import package"
run: "python -c 'import westpa; print(westpa.__version__)'"