Updating-Changelog-and-version #42
This file contains hidden or 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: CI Workflow | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- rel/** | |
pull_request: | |
branches: | |
- main | |
permissions: read-all | |
jobs: | |
lint: | |
name: Linting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10.14' | |
- name: Install dev dependencies | |
run: pip install -r requirements-dev.txt | |
- name: Run pre-commit linting | |
run: pre-commit run --all-files | |
system-tests: | |
name: System Tests | |
runs-on: windows-latest | |
needs: [tests,lint] | |
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/rel/')) | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install test dependencies | |
run: pip install -r requirements-test.txt | |
- name: Run system tests with tox | |
run: tox -e system_tests | |
env: | |
DAR_CLIENT_ID: ${{ secrets.DAR_CLIENT_ID }} | |
DAR_CLIENT_SECRET: ${{ secrets.DAR_CLIENT_SECRET }} | |
DAR_AUTH_URL: ${{ secrets.DAR_AUTH_URL }} | |
DAR_URL: ${{ secrets.DAR_URL }} | |
- name: Create Github Release for Tag | |
if: startsWith(github.ref, 'refs/tags/rel/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
body: "Tagging release ${{ github.ref }}" | |
files: system_test_results/traceability.html | |
tests: | |
name: Tests on Linux, Windows and macOS environments | |
runs-on: ${{ matrix.os}} | |
strategy: | |
matrix: | |
include: | |
- python-version: '3.10' | |
toxenv: 'py310-cov' | |
os: ubuntu-latest | |
- python-version: '3.11' | |
toxenv: 'py311-cov' | |
os: ubuntu-latest | |
- python-version: 'pypy3.10' | |
toxenv: 'pypy3-cov' | |
os: ubuntu-latest | |
- python-version: '3.10' | |
toxenv: 'py310-cov' | |
os: windows-latest | |
- python-version: '3.10' | |
toxenv: 'py310-cov' | |
os: macos-13 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install test dependencies | |
run: pip install -r requirements-test.txt | |
- name: Run tests with tox | |
run: tox -e ${{ matrix.toxenv }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
name: Deploy to PyPI | |
runs-on: ubuntu-latest | |
needs: [system-tests] | |
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/rel/') | |
permissions: | |
contents: read | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Build distributions | |
run: pipx run build --sdist --wheel | |
- name: Deploy release to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 # Uses OIDC/Workload identities and doesn't require a token |