Skip to content

erm

erm #14

name: Python package
on:
push:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pylint build
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Analysing the code with pylint
run: |
pylint --fail-under=9.5 --disable=R0401,E0611 $(git ls-files '*.py')
- name: Test with pytest
run: |
pytest -v tests/run_tests.py
- name: Build package
run: |
python -m build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: python-package
path: dist/
- name: Create GitHub beta release
uses: softprops/action-gh-release@v1
with:
tag_name: beta-${{ github.run_number }}
release_name: "Beta Release ${{ github.run_number }}"
body: |
This is a beta release containing build artifacts.
draft: false # Automatically publish the release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload all release assets from dist/
uses: softprops/action-gh-release@v1
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: dist/*
asset_name: python-package-${{ github.run_number }}.tar.gz
asset_content_type: application/gzip