Skip to content

Commit

Permalink
Rewrite CI: use reusable actions, native arm and faster PR testing (#…
Browse files Browse the repository at this point in the history
…1153)

This commit rewrites the CI configuration to use reusable actions for
testing with nox and setting up Python.

It also uses the new native arm runners, upgrade to use the Ubuntu 24.04
GitHub runner and split the CI into two workflows: one for PRs and one
for pushes.

The PR workflow only runs the nox tests for the default Python version
and test the documentation website generation, so it should be much
quicker.

When pushing (to any branch, including merge queues, and tags), a more
through CI is run, including all the nox sessions for all supported
Python versions, archs and OSes, building the distribution packages,
testing the installation of the built packages, publishing the
documentation website, creating a GitHub release and publishing the
packages to PyPI.
  • Loading branch information
llucax authored Jan 28, 2025
2 parents e2d4536 + aee74f1 commit 0ba3a3c
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 223 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Test PR

on: pull_request

env:
# Please make sure this version is included in the `matrix`, as the
# `matrix` section can't use `env`, so it must be entered manually
DEFAULT_PYTHON_VERSION: '3.11'
# It would be nice to be able to also define a DEFAULT_UBUNTU_VERSION
# but sadly `env` can't be used either in `runs-on`.

jobs:
nox:
name: Test with nox
runs-on: ubuntu-24.04

steps:
- name: Run nox
uses: frequenz-floss/[email protected]
with:
python-version: "3.11"
nox-session: ci_checks_max

test-docs:
name: Test documentation website generation
runs-on: ubuntu-24.04
steps:
- name: Setup Git
uses: frequenz-floss/[email protected]

- name: Fetch sources
uses: actions/checkout@v4
with:
submodules: true

- name: Setup Python
uses: frequenz-floss/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
dependencies: .[dev-mkdocs]

- name: Generate the documentation
env:
MIKE_VERSION: gh-${{ github.job }}
run: |
mike deploy $MIKE_VERSION
mike set-default $MIKE_VERSION
- name: Upload site
uses: actions/upload-artifact@v4
with:
name: docs-site
path: site/
if-no-files-found: error
Loading

0 comments on commit 0ba3a3c

Please sign in to comment.