-
Notifications
You must be signed in to change notification settings - Fork 4
96 lines (79 loc) · 2.26 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Tox CI with Conda
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
jobs:
flake8:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: 3.11
auto-activate-base: false
- name: Create and activate environment
run: |
conda create -n test-env python=3.11 flake8 -y
conda init
source ~/.bashrc
conda activate test-env
pip install tox tox-conda
- name: Run Flake8
run: |
conda init
source ~/.bashrc
conda activate test-env
tox -e flake8
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8,3.9,3.10.15,3.11,3.12,3.13]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
auto-activate-base: false
- name: Create and activate environment
run: |
conda create -n test-env python=${{ matrix.python-version }} -y
conda init
source ~/.bashrc
conda activate test-env
pip install tox tox-conda
- name: Install GCC and GFortran
run: |
sudo apt-get update
sudo apt-get install -y gcc gfortran
- name: Install dependencies
run: |
sudo apt-get install -y bc ninja-build
- name: Run Tox
run: |
conda init
source ~/.bashrc
conda activate test-env
tox -e py$(echo ${{ matrix.python-version }} | tr -d . | cut -c 1-3)
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests