-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (82 loc) · 2.34 KB
/
run_tests.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
---
name: "Tests"
on:
push:
branches:
- main
- master
paths:
- "**.py"
- ".github/workflows/test*.yml"
- "pyproject.toml"
- "poetry.lock"
- "conda-lock.yml"
- "requirements/*"
pull_request:
paths:
- "**.py"
- ".github/workflows/test*.yml"
- "pyproject.toml"
- "poetry.lock"
- "conda-lock.yml"
- "requirements/*"
jobs:
run_tests:
name: "test ${{ matrix.python-version }} on ${{ matrix.os }}"
strategy:
fail-fast: true
matrix:
os:
- "ubuntu"
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
include:
- os: "macos"
python-version: "3.9"
runs-on: "${{ matrix.os }}-latest"
defaults:
run:
shell: "bash -el {0}"
steps:
- uses: "actions/checkout@main"
# Setup conda + cache
- name: "Cache conda pkgs"
uses: "actions/cache@main"
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
LOCK_FILE: "ci/conda-lock-${{ runner.os }}-64-py${{ matrix.python-version }}"
with:
path: "~/conda_pkgs_dir"
key: "conda-${{ runner.os }}-${{ hashFiles( env.LOCK_FILE ) }}-${{ env.CACHE_NUMBER }}"
- name: "Setup conda"
uses: "conda-incubator/setup-miniconda@v3"
with:
activate-environment: "inspectds_ci"
# python-version: ${{ matrix.python-version }}
# mamba-version: "*"
channels: "conda-forge"
auto-update-conda: true
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
channel-priority: "strict"
environment-file: "ci/conda-lock-${{ runner.os }}-64-py${{ matrix.python-version }}"
- run: printenv | sort
- run: |
conda info
mamba info
conda list
conda config --show-sources
conda config --show
- run: |
which python
python --version
python -m pip --version
python -m pip cache info
- run: "python -mpip install -r requirements/requirements-dev.txt"
- run: python -m cfgrib selfcheck
- run: mypy --version
- run: mypy inspectds
- run: make test