This is version 1.5.0. #34
Workflow file for this run
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: Tests | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
tags: | |
- 'v*' | |
- '!v*-dev' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install coveralls nose2 pylint setuptools wheel dpkt | |
- name: Test with nose2 | |
run: | | |
cd tests && nose2 -C --coverage ../communityid --coverage-report term-missing communityid_test | |
- name: Build package | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Preserve built package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: communityid-py${{ matrix.python-version }}.tar.gz | |
path: dist/*.tar.gz | |
versioncheck: | |
runs-on: ubuntu-latest | |
needs: [test] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'corelight/pycommunityid' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check git tag format | |
run: | | |
if ! echo ${{ github.ref }} | grep -E '/v[0-9]+\.[0-9]+(\.[0-9]+)?$'; then echo "${{ github.ref }} is not a git tag for PyPI"; exit 1; fi | |
- name: Check setup.py version against git tag | |
run: | | |
tagver="$(echo ${{ github.ref }} | sed 's/.\+\/v//')" | |
setupver="$(python3 setup.py --version)" | |
if [ $tagver != $setupver ]; then echo "Git tag / setup.py version mismatch: $tagver / $setupver"; exit 1; fi | |
upload: | |
runs-on: ubuntu-latest | |
needs: [versioncheck] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'corelight/pycommunityid' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build wheel | |
run: | | |
python3 setup.py bdist_wheel | |
- name: Upload to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |