-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (51 loc) · 1.52 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
# reusable workflow to run tests on different installation types and OS
name: Run unit tests
on:
workflow_call:
inputs:
os:
required: true
type: string
python-version:
required: true
type: string
install-script:
required: true
type: string
test-script:
required: true
type: string
jobs:
run-unit-tests:
name: Unit tests (${{ inputs.os }}, ${{ inputs.python-version }})
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
auto-update-conda: true
python-version: ${{ inputs.python-version }}
- name: Setup pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ inputs.python-version }}-${{ hashFiles('**/requirements*.txt') }}
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Install mono
if: ${{ !contains(inputs.os, 'windows') }}
shell: bash -l {0}
run: |
conda install mono
- name: Perform pip installation with stable dependencies
shell: bash -l {0}
run: |
cd misc
. ./${{ inputs.install-script }} alphadia ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }}
- name: Run tests
shell: bash -l {0}
run: |
cd tests
. ./${{ inputs.test-script }} alphadia ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }}