-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.4 KB
/
install_and_test.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
# This workflow will setup conda, create a virtual environment with required packages and dependencies,
# execute script utils/create_test_files.py,
# and run tests with pytest
name: Install and run tests
on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
#permissions:
# contents: read
jobs:
build:
name: Install and test on (${{ matrix.os }}, Miniforge)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11.5"]
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: false
python-version: ${{ matrix.python-version }}
environment-file: environment_dev.yaml
activate-environment: oac
miniforge-version: latest
- name: Conda info
run: |
conda info
conda list
- name: Set PYTHONPATH variable
run: |
PYTHONPATH="$GITHUB_WORKSPACE/utils:$GITHUB_WORKSPACE/tests:$PYTHONPATH"
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
echo $GITHUB_ENV
- name: Create test files
run: |
cd utils/
chmod a+x create_test_files.py
python create_test_files.py
cd ..
- name: Test with pytest
run: |
cd tests/
pytest