Skip to content

some optimize

some optimize #243

Workflow file for this run

# 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@v4
- name: Conda install
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: sats-receiver-test-venv
channel-priority: strict
- 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@v4
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@v4
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 -n sats-receiver-test-venv -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
conda list -n sats-receiver-test-venv
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@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}