forked from NCAR/ADF
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.5 KB
/
ADF_unit_tests.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
name: Framework Unit Tests
on:
pull_request:
types: [opened, synchronize, reopened]
push:
# Run the tests one more time, after the PR changes
# have been pushed. The if-statement below prevents
# the push from running on other repos.
branches:
#Trigger workflow on push to any branch or branch heirarchy:
- '**'
jobs:
#This job is designed to run all python unit tests whenever
#a PR is either opened or synced (i.e. additional commits are pushed
#to branch involved in PR).
python_unit_tests:
if: github.event_name == 'pull_request' || github.repository == 'NCAR/ADF'
runs-on: ubuntu-latest
strategy:
matrix:
#All of these python versions will be used to run tests:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
fail-fast: false
steps:
# Acquire github action routines:
- uses: actions/checkout@v3
# Acquire specific version of python:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Install needed python packages:
- name: Install dependencies
run: |
python -m pip install --upgrade pip # Install latest version of PIP
pip install pyyaml # Install PyYAML python package
pip install pytest # Install pytest python package
# Run python unit tests related to ADF library:
- name: ADF lib unit tests
run: pytest lib/test/unit_tests