-
Notifications
You must be signed in to change notification settings - Fork 24
43 lines (34 loc) · 1.18 KB
/
unit-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
name: Run Unit Tests
on: [push, pull_request]
jobs:
unit-test:
runs-on: ubuntu-20.04 # 20.04 to allow for Py 3.6
strategy:
fail-fast: false
matrix:
# Python versions on Rocky 8, Ubuntu 20.04, Rocky 9
python-version: ['3.6', '3.8', '3.9']
name: Python ${{ matrix.python-version }} test
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Set up dependencies for python-ldap
run: sudo apt-get install libsasl2-dev libldap2-dev libssl-dev
- name: Base requirements for SSM
run: pip install -r requirements.txt
- name: Additional requirements for the unit and coverage tests
run: pip install -r requirements-test.txt
- name: Pre-test set up
run: |
export TMPDIR=$PWD/tmp
mkdir $TMPDIR
export PYTHONPATH=$PYTHONPATH:`pwd -P`
cd test
- name: Run unit tests
run: coverage run --branch --source=ssm,bin -m unittest discover --buffer
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4