docs: Cleaned up formatting #30
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: 'Squishy CI' | |
on: | |
push: | |
branches-ignore: | |
- 'gh-pages' | |
paths: | |
- '.github/workflows/ci.yml' | |
- 'docs/**' | |
- 'examples/**' | |
- 'tests/**' | |
- 'squishy/**' | |
- 'firmware/**' | |
- 'noxfile.py' | |
- 'pyproject.toml' | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
branches: | |
- main | |
env: | |
TOOL_PYTHON_VERSION: '3.11' | |
jobs: | |
lint-squishy: | |
runs-on: ubuntu-latest | |
name: 'Lint Squishy' | |
steps: | |
- name: 'Setup Python (${{ env.TOOL_PYTHON_VERSION }})' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.TOOL_PYTHON_VERSION }} | |
- name: 'Initialize Environment' | |
shell: bash | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
echo "$HOME/.local/bin:$PATH" >> $GITHUB_PATH | |
echo "GITHUB_WORKSPACE=\"`pwd`\"" >> $GITHUB_ENV | |
- name: 'Install Dependencies' | |
shell: bash | |
run: | | |
python -m pip install --user --upgrade pip setuptools wheel setuptools_scm nox | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: 'Install uv' | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: false | |
- name: 'Run Style Lint' | |
shell: bash | |
continue-on-error: true | |
run: | | |
nox -s lint | |
- name: 'Run Type Checking' | |
shell: bash | |
continue-on-error: true | |
run: | | |
nox -s typecheck-mypy | |
test-squishy: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.11', '3.12', '3.13', ] | |
allow-failure: | |
- false | |
include: | |
- python-version: '3.14-dev' | |
allow-failure: true | |
name: 'Squishy - Test (Python ${{ matrix.python-version }})' | |
continue-on-error: ${{ matrix.allow-failure }} | |
steps: | |
- name: 'Setup Python (${{ matrix.python-version }})' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: 'Initialize Environment' | |
shell: bash | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
echo "$HOME/.local/bin:$PATH" >> $GITHUB_PATH | |
echo "GITHUB_WORKSPACE=\"`pwd`\"" >> $GITHUB_ENV | |
- name: 'Install Dependencies' | |
shell: bash | |
run: | | |
python -m pip install --user --upgrade pip setuptools wheel setuptools_scm nox | |
- name: 'Setup OSS CAD Suite' | |
uses: YosysHQ/setup-oss-cad-suite@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: 'Install uv' | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: false | |
- name: 'Run Tests' | |
timeout-minutes: 30 # Python 3.12+ Seem to take literally *hours* | |
continue-on-error: ${{ matrix.python-version == '3.12' || matrix.python-version == '3.13' || startsWith(matrix.python-version, '3.14') }} | |
shell: bash | |
run: | | |
nox -s test | |
- name: 'Codecov Upload' | |
if: success() && github.repository == 'squishy-scsi/squishy' | |
uses: codecov/codecov-action@v5 | |
with: | |
verbose: true | |
files: ./build/tests/coverage.xml | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build-firmware: | |
runs-on: ubuntu-latest | |
name: 'Squishy - Build Firmware' | |
steps: | |
- name: 'Initialize Environment' | |
shell: bash | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
echo "$HOME/.local/bin:$PATH" >> $GITHUB_PATH | |
echo "GITHUB_WORKSPACE=\"`pwd`\"" >> $GITHUB_ENV | |
- name: 'Setup ARM GCC' | |
uses: carlosperate/arm-none-eabi-gcc-action@v1 | |
with: | |
release: '14.2.Rel1' | |
- name: 'Install Dependencies' | |
shell: bash | |
run: | | |
python -m pip install --user --upgrade pip setuptools wheel | |
python -m pip install meson ninja | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: 'Build Firmware' | |
shell: bash | |
run: | | |
meson setup --cross-file contrib/arm-none-eabi.meson build firmware | |
meson compile -C build | |
linkcheck-docs: | |
runs-on: ubuntu-latest | |
name: 'Squishy Docs - Link-check' | |
steps: | |
- name: 'Setup Python (${{ env.TOOL_PYTHON_VERSION }})' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.TOOL_PYTHON_VERSION }} | |
- name: 'Initialize Environment' | |
shell: bash | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
echo "$HOME/.local/bin:$PATH" >> $GITHUB_PATH | |
echo "GITHUB_WORKSPACE=\"`pwd`\"" >> $GITHUB_ENV | |
- name: 'Install Dependencies' | |
shell: bash | |
run: | | |
python -m pip install --user --upgrade pip setuptools wheel setuptools_scm nox | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: 'Install uv' | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: false | |
- name: 'Link Check' | |
shell: bash | |
run: | | |
nox -s linkcheck-docs | |
build-docs: | |
runs-on: ubuntu-latest | |
name: 'Squishy Docs - Build' | |
steps: | |
- name: 'Setup Python (${{ env.TOOL_PYTHON_VERSION }})' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.TOOL_PYTHON_VERSION }} | |
- name: 'Initialize Environment' | |
shell: bash | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
echo "$HOME/.local/bin:$PATH" >> $GITHUB_PATH | |
echo "GITHUB_WORKSPACE=\"`pwd`\"" >> $GITHUB_ENV | |
- name: 'Install Dependencies' | |
shell: bash | |
run: | | |
python -m pip install --user --upgrade pip setuptools wheel setuptools_scm nox | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 'Install uv' | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: false | |
- name: 'Build Docs' | |
shell: bash | |
run: | | |
nox -s build-docs | |
- name: 'Upload docs artifact' | |
if: success() && github.repository == 'squishy-scsi/squishy' && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && github.event_name == 'push' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
include-hidden-files: true | |
path: ./build/docs | |
retention-days: 1 | |
docs: | |
name: 'Squishy Docs (Meta Job)' | |
needs: | |
- linkcheck-docs | |
- build-docs | |
runs-on: ubuntu-latest | |
steps: | |
- run: ${{ contains(needs.*.result, 'failure') && 'false' || 'true' }} | |
ci-checkpoint: | |
name: 'Squishy CI Checkpoint (Meta Job)' | |
needs: | |
- lint-squishy | |
- test-squishy | |
- build-firmware | |
- docs | |
runs-on: ubuntu-latest | |
steps: | |
- run: ${{ contains(needs.*.result, 'failure') && 'false' || 'true' }} | |
publish-docs: | |
name: 'Publish Squishy Docs' | |
if: github.repository == 'squishy-scsi/squishy' && (github.event.ref == 'refs/heads/main' || startsWith(github.event.ref, 'refs/tags/v')) && github.event_name == 'push' | |
needs: | |
- ci-checkpoint | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: 'Download docs artifact' | |
uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
path: built_docs/ | |
- name: 'Deploy Docs' | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
repository-name: squishy-scsi/documentation | |
ssh-key: ${{ secrets.DEPLOY_KEY }} | |
folder: built_docs/ | |
clean: true | |
publish-pypi: | |
name: 'Squishy - Publish PyPi package' | |
if: github.repository == 'squishy-scsi/squishy' && github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') && !contains(github.event.ref, 'dev') | |
needs: | |
- publish-docs | |
- ci-checkpoint | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/squishy | |
permissions: | |
id-token: write | |
steps: | |
- name: 'Setup Python (${{ env.TOOL_PYTHON_VERSION }})' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.TOOL_PYTHON_VERSION }} | |
- name: 'Initialize Environment' | |
shell: bash | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
echo "$HOME/.local/bin:$PATH" >> $GITHUB_PATH | |
echo "GITHUB_WORKSPACE=\"`pwd`\"" >> $GITHUB_ENV | |
- name: 'Install Dependencies' | |
shell: bash | |
run: | | |
python -m pip install --user --upgrade pip setuptools wheel setuptools_scm nox twine build | |
- name: 'Checkout' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: 'Install uv' | |
uses: astral-sh/setup-uv@v6 | |
with: | |
enable-cache: false | |
- name: 'Build wheel' | |
shell: bash | |
run: | | |
nox -s dist | |
- name: 'Check package' | |
shell: bash | |
run: | | |
twine check build/dist/* | |
- name: 'Publish to PyPi' | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: build/dist/ | |
- name: 'Upload wheel artifact' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheels | |
path: build/dist/ |