-
Notifications
You must be signed in to change notification settings - Fork 1
117 lines (102 loc) · 3.64 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
106
107
108
109
110
111
112
113
114
115
116
117
name: CI
on:
push:
branches: [ main ]
pull_request:
jobs:
unittest:
name: Unit tests - ${{ matrix.PYTHON_VERSION }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ["3.10"]
defaults:
run:
# see https://github.com/conda-incubator/setup-miniconda/#important
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- name: Set up Conda env
uses: mamba-org/provision-with-micromamba@e2b397b12d0a38069451664382b769c9456e3d6d
with:
cache-env: true
extra-specs: |
python=${{ matrix.PYTHON_VERSION }}
- name: Install repository
run: python -m pip install --no-build-isolation --no-deps --disable-pip-version-check -e .
- name: Pytest
run: pytest --cov --cov-report xml tests
- name: codecov
uses: codecov/[email protected]
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
name: pytest-python${{ matrix.PYTHON_VERSION }}
pre-commit-checks:
name: "Linux - pre-commit checks - Python 3.10"
timeout-minutes: 30
runs-on: ubuntu-latest
env:
PRE_COMMIT_USE_MICROMAMBA: 1
steps:
- name: Checkout branch
uses: actions/[email protected]
- name: Set up micromamba
uses: mamba-org/setup-micromamba@d05808540d968a55ca33c798e0661fb98f533c73
- name: Add micromamba to GITHUB_PATH
run: echo "${HOME}/micromamba-bin" >> "$GITHUB_PATH"
- name: Install Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run pre-commit checks
uses: pre-commit/[email protected]
asv-benchmarks:
name: ASV benchmarks
runs-on: ubuntu-latest
defaults:
run:
# see https://github.com/conda-incubator/setup-miniconda/#important
shell: bash -l {0}
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Fetch git history
run: git fetch --prune --unshallow
- name: Set up Conda env
uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
environment-file: environment.yml
cache-environment: true
init-shell: bash
create-args: python=3.10 asv
# https://github.com/airspeed-velocity/asv/pull/1403
- name: Downgrade conda
run: conda install -n base -c conda-forge -y conda=23
# - name: Add micromamba to GITHUB_PATH
# run: echo "${HOME}/micromamba-bin" >> "$GITHUB_PATH"
# # https://stackoverflow.com/questions/77617946/solve-conda-libmamba-solver-libarchive-so-19-error-after-updating-conda-to-23
# - name: force mamba reinstall
# run: conda install -n base libarchive -c main --force-reinstall --solver classic -y
# - name: Install repository
# run: python -m pip install --no-build-isolation --no-deps --disable-pip-version-check -e .
# - name: Run ASV benchmarks
# run: |
# asv machine --machine github-runner --yes
# export OPENBLAS_NUM_THREADS=1
# asv --config asv.conf.json run -m github-runner --quick --python=same
# asv --config asv.conf.json publish
# - name: Upload ASV results
# uses: actions/upload-artifact@v4
# with:
# name: asv-results
# path: html
- name: asv continuous
run: |
cd benchmarks
asv machine --machine github-runner --yes
asv continuous origin/main HEAD -e -v --factor 1.2 --machine github-runner --config asv.conf.json