CI: Add "trusted publishing" workflow #5
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 Tests | |
on: [push, pull_request] | |
env: | |
PYTEST_ADDOPTS: "--color=yes" | |
jobs: | |
tests: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
jack: jackd2 | |
- os: ubuntu-latest | |
jack: jackd1 | |
# x86_64: | |
- os: macos-13 | |
# arm64: | |
- os: macos-latest | |
- os: windows-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install JACK on Ubuntu | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends ${{ matrix.jack }} | |
- name: Install JACK on macOS | |
if: startsWith(matrix.os, 'macos') | |
run: | | |
brew install jack | |
- name: Install JACK on Windows | |
if: startsWith(matrix.os, 'windows') | |
# Inspired by https://github.com/supercollider/supercollider/blob/develop/.github/workflows/actions.yml | |
shell: bash | |
run: | | |
JACK2_RELEASE=v1.9.22 | |
curl -O -J -L https://github.com/jackaudio/jack2-releases/releases/download/$JACK2_RELEASE/jack2-win64-$JACK2_RELEASE.exe | |
./jack2-win64-$JACK2_RELEASE.exe //SILENT //SUPPRESSMSGBOXES | |
echo "/c/Program Files/JACK2" >> $GITHUB_PATH | |
- name: Start jackd with "dummy" backend | |
# With "bash", this works even on Windows! | |
shell: bash | |
run: | | |
jackd --no-realtime -d dummy & | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3" | |
- name: Double-check Python version | |
run: | | |
python --version | |
- uses: actions/checkout@v4 | |
- name: Install Python package | |
run: | | |
python -m pip install . | |
- name: Install pytest | |
run: | | |
python -m pip install pytest | |
- name: Run tests | |
run: | | |
python -m pytest | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3" | |
- name: Double-check Python version | |
run: | | |
python --version | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install doc dependencies | |
run: | | |
python -m pip install -r doc/requirements.txt | |
- name: Create HTML docs | |
run: | | |
python -m sphinx -W --keep-going --color -d _build/doctrees doc _build/html -b html | |
- name: Check for broken links | |
run: | | |
python -m sphinx -W --keep-going --color -d _build/doctrees doc _build/linkcheck -b linkcheck |