Skip to content

Merge remote-tracking branch 'upstream/main' #1

Merge remote-tracking branch 'upstream/main'

Merge remote-tracking branch 'upstream/main' #1

name: Build, test, and deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# Run every Monday
- cron: '0 0 * * 1'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
# Skip Python 3.8 on macOS as it's not available
- os: macos-latest
python-version: "3.8"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .[dev]
- name: Run tests
run: |
python -m nox -s test --python ${{ matrix.python-version }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false
verbose: true
docs:
name: Build documentation
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .[dev]
- name: Build docs
run: |
python -m nox -s docs
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && github.repository_owner == 'cocotb'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs/_build/html
branch: gh-pages
clean: true