forked from ARM-DOE/ACT
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (68 loc) · 2.33 KB
/
ci.yml
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
name: Run Unit Tests CI
on:
schedule:
# Runs at 09Z (2am CDT)
- cron: "0 9 * * *"
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Cancel concurrent runs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ARM_USERNAME: ${{ secrets.ARM_USERNAME }}
ARM_PASSWORD: ${{ secrets.ARM_PASSWORD }}
AIRNOW_API: ${{ secrets.AIRNOW_API }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_TOKEN: ${{ secrets.COVERLALLS_REPO_TOKEN }}
jobs:
build:
name: ${{ matrix.os }}-${{ matrix.python-version }}
if: github.repository == 'ARM-DOE/ACT'
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [macOS, ubuntu, Windows]
steps:
- uses: actions/checkout@v4
- name: Setup Conda Environment
uses: mamba-org/setup-micromamba@v2
with:
create-args: python=${{ matrix.python-version }}
environment-file: ./continuous_integration/environment_actions.yml
environment-name: act_env
micromamba-version: 1.5.10-0
- name: Fetch all history for all tags and branches
run: |
git fetch --prune --unshallow
- name: Install ACT
run: |
python -m pip install -e . --no-deps --force-reinstall
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# Switching back to original flake
python -m flake8 --max-line-length=127 --ignore=F401,E402,W504,W605,F403
- name: Test with pytest
run: |
python -m pytest -v --mpl --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}