Skip to content

nrf-sniffer-cli

nrf-sniffer-cli #363

Workflow file for this run

name: nrf-sniffer-cli
on:
push:
branches: [main]
paths-ignore: ['**.md']
pull_request:
paths-ignore: ['**.md']
schedule:
- cron: 30 3 * * *
release:
types: [ created ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
run: |
pip install .
pip install .[dev]
- name: run tests
run: python -m pytest --cov SnifferAPI --cov-report=html .
- name: pylint (always pass)
run: pylint --exit-zero SnifferAPI
- name: Archive code coverage results
if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: htmlcov/*
publish:
needs: [test]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
pip install .
pip install setuptools wheel twine
- name: create packages
run: |
python setup.py sdist
python setup.py bdist_wheel
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1