Skip to content

CI

CI #8283

Workflow file for this run

name: CI
on:
push:
branches-ignore:
- "wip*"
tags:
- "v*"
pull_request:
schedule:
# Daily at 5:12
- cron: "12 5 * * *"
workflow_dispatch:
concurrency:
group: ci-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
jobs:
list:
runs-on: ubuntu-latest
outputs:
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- id: noxenvs-matrix
run: |
echo >>$GITHUB_OUTPUT noxenvs=$(
uvx nox --list-sessions --json | jq '[.[].session]'
)
ci:
needs: list
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
noxenv: ${{ fromJson(needs.list.outputs.noxenvs) }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libenchant-2-dev
if: runner.os == 'Linux' && startsWith(matrix.noxenv, 'docs')
- name: Install dependencies
run: brew install enchant podman
if: runner.os == 'macOS'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: |
3.12
3.13
allow-prereleases: true
- name: Install Node
uses: actions/setup-node@v4
with:
node-version-file: frontend/package.json
if: startsWith(matrix.noxenv, 'ui')
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: frontend/package.json
run_install: false
if: startsWith(matrix.noxenv, 'ui')
- name: Install playwright browsers
run: pnpm --dir frontend dlx playwright install --with-deps
if: matrix.noxenv == 'ui(tests)'
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Run nox
run: uvx nox -s "${{ matrix.noxenv }}"
- name: Upload Playwright Report
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: frontend/test-results
retention-days: 14
if: matrix.noxenv == 'ui(tests)'
containerless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Ensure containers don't work
run: sudo apt-get purge docker podman
- name: Run nox
run: uvx nox -s tests-3.13 -- -m 'not containers'
coverage:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Run nox
run: uvx nox -s tests-3.13 -- coverage github
automerge:
needs: ci
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
permissions:
contents: write
pull-requests: write
steps:
- name: Automatically merge allowed PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
packaging:
needs: ci
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.tag }}
environment:
name: PyPI
url: https://pypi.org/p/bowtie-json-schema
permissions:
contents: write
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Build our distributions
run: uv run --frozen --with 'build[uv]' -m build --installer=uv
- name: Generate attestation for wheels
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: actions/attest-build-provenance@v2
with:
subject-path: "dist/*.whl"
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create a Release
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
- name: Current version
id: version
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
report:
needs: packaging
uses: ./.github/workflows/report.yml
with:
bowtie-version: ${{ needs.packaging.outputs.version }}
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')