Use self-hosted runners python3.9 for release testing #220
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint Code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: setup CI | |
uses: lava-nc/ci-setup-composite-action@v1.2 | |
with: | |
repository: 'Lava' | |
- name: Run flakeheaven (flake8) | |
run: poetry run flakeheaven lint src/lava tests/ | |
security-lint: | |
name: Security Lint Code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: setup CI | |
uses: lava-nc/ci-setup-composite-action@v1.2 | |
with: | |
repository: 'Lava' | |
- name: Run bandit | |
uses: tj-actions/bandit@v5.1 | |
with: | |
targets: | | |
src/lava/. | |
options: "-r --format custom --msg-template '{abspath}:{line}: {test_id}[bandit]: {severity}: {msg}'" | |
unit-tests: | |
name: Unit Test Code + Coverage | |
runs-on: ${{ matrix.operating-system }} | |
strategy: | |
matrix: | |
operating-system: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- name: install dependencies | |
run: | | |
sudo add-apt-repository ${{ secrets.METAVISION_SETUP}} >> /dev/null | |
sudo add-apt-repository ppa:deadsnakes/ppa >> /dev/null | |
sudo apt update >> /dev/null >> /dev/null | |
sudo apt -y install python3.9-dev >> /dev/null | |
sudo apt -y install metavision-sdk metavision-sdk-python3.9 >> /dev/null | |
- name: setup CI | |
uses: lava-nc/ci-setup-composite-action@v1.3_py3.9 | |
with: | |
repository: 'Lava' | |
- name: Run unit tests | |
run: | | |
poetry run pip install pyrealsense2 | |
export PYTHONPATH=$PYTHONPATH:/usr/lib/python3/dist-packages | |
poetry run git lfs fetch | |
poetry run git lfs pull | |
poetry run coverage run -m unittest discover -s tests/ -t . -vv | |
- name: Generate coverage report | |
if: runner.os == 'Linux' | |
run: poetry run coverage xml | |
- name: Archive coverage report | |
if: runner.os == 'Linux' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: coverage.xml | |
retention-days: 30 |