-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (65 loc) · 2.3 KB
/
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Tests
on:
push:
branches: ["dev"]
pull_request:
branches: ["dev"]
permissions:
contents: read
jobs:
unittests:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
- name: Conda install
uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: false
activate-environment: sats-receiver-test-venv
channel-priority: strict
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Get Variables
id: get-vars
run: |
echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
echo "pip-cache-dir=$(pip cache dir)" >> $GITHUB_OUTPUT
shell: bash
- name: pip cache
uses: actions/cache@v3
id: pip-cache
with:
path: ${{ steps.get-vars.outputs.pip-cache-dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
- name: Conda cache
uses: actions/cache@v3
id: conda-cache
env:
# Increase this value to reset cache if test-env.yml has not changed
CACHE_NUMBER: 0
with:
path: ${{ env.CONDA_PKGS_DIR }}
key:
conda-${{ runner.os }}-${{ runner.arch }}-${{
steps.get-vars.outputs.today }}-${{
hashFiles('test-env.yml') }}-${{ env.CACHE_NUMBER }}
- name: Update environment
run: conda env update -f test-env.yml
- name: Prepare GNURadio
run: |
mkdir -p $HOME/.gnuradio/prefs
chown -R $(id -u):$(id -g) $HOME/.gnuradio/
echo "gr::vmcircbuf_sysv_shm_factory" > $HOME/.gnuradio/prefs/vmcircbuf_default_factory
shell: bash
- name: Run tests and collect coverage
run: coverage run --omit=tests/* --source=sats_receiver -m unittest discover -v
- name: Generate report
run: coverage xml
- name: Show report
run: coverage report -m
- name: Send report to codecov
uses: codecov/codecov-action@v3