-
Notifications
You must be signed in to change notification settings - Fork 11
56 lines (53 loc) · 1.67 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
name: Main CI
on:
pull_request:
push:
branches: [main]
workflow_call:
env:
CACHE_NUMBER: 0 # increase to reset cache manually
jobs:
test-cpu:
name: Test CPU (Linux)
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
max-parallel: 1
fail-fast: true
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8"]
defaults:
run:
shell: bash -el {0}
steps:
- name: Checkout git repo
uses: actions/checkout@master
- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
auto-update-conda: true
activate-environment: nos-${{ matrix.os }}-${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}
use-mamba: true
- name: Conda info
run: conda info
- name: Conda list
run: conda list
- uses: actions/cache@v3
with:
path: /usr/share/miniconda3/envs/nos-${{ matrix.os }}-${{ matrix.python-version }}
key: conda-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements/requirements*.txt') }}-${{ hashFiles('pyproject.toml') }}-${{ env.CACHE_NUMBER }}
id: cache
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ env.CACHE_NUMBER }}
- name: Install dependencies
run: make develop-cpu
if: steps.cache.outputs.cache-hit != 'true'
- name: Quality Check
run: make lint
- name: Test
run: make test-cpu