Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitHub Actions native arm64 runners #341

Closed
llucax opened this issue Jan 17, 2025 · 4 comments · Fixed by #369
Closed

Use GitHub Actions native arm64 runners #341

llucax opened this issue Jan 17, 2025 · 4 comments · Fixed by #369
Labels
part:ci Affects the GitHub workflow and other parts for running CI part:template Affects the cookiecutter template files type:enhancement New feature or enhancement visitble to users
Milestone

Comments

@llucax
Copy link
Contributor

llucax commented Jan 17, 2025

What's needed?

Now native arm64 runners are available for public projects:

https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview

Proposed solution

Remove the nox-cross-arch jobs and just add this arch to the nox matrix.

Additional context

If we switch to the nox action, we can use something like this:

jobs:
  nox:
    name: Test with nox
    strategy:
      fail-fast: false
      matrix:
        arch:
          - amd64
          - arm
        os:
          - ubuntu-22.04
        python:
          - "3.11"
        nox-session:
          # To speed things up a bit we use the special ci_checks_max session
          # that uses the same venv to run multiple linting sessions
          - "ci_checks_max"
          - "pytest_min"
    runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }}

    steps:
      - name: Run nox
        uses: frequenz-floss/[email protected]
        with:
          python-version: ${{ matrix.python }}
          nox-session: ${{ matrix.nox-session }}

  # This job runs if all the `nox` matrix jobs ran and succeeded.
  # It is only used to have a single job that we can require in branch
  # protection rules, so we don't have to update the protection rules each time
  # we add or remove a job from the matrix.
  nox-all:
    # The job name should match the name of the `nox` job.
    name: Test with nox
    needs: ["nox"]
    # We skip this job only if nox was also skipped
    if: always() && needs.nox.result != 'skipped'
    runs-on: ubuntu-22.04
    env:
      DEPS_RESULT: ${{ needs.nox.result }}
    steps:
      - name: Check matrix job result
        run: test "$DEPS_RESULT" = "success"
@llucax llucax added part:ci Affects the GitHub workflow and other parts for running CI part:template Affects the cookiecutter template files type:enhancement New feature or enhancement visitble to users labels Jan 17, 2025
@llucax llucax added this to the v0.12.0 milestone Jan 17, 2025
@llucax
Copy link
Contributor Author

llucax commented Jan 24, 2025

@llucax
Copy link
Contributor Author

llucax commented Jan 24, 2025

Note the runner names for public repos are arm and not arm64.

@llucax llucax modified the milestones: v0.12.0, v0.13.0 Feb 10, 2025
@llucax
Copy link
Contributor Author

llucax commented Feb 14, 2025

If we do this, we also need to update the trusted publishers in PyPI to allow publishing from the new workflow.

@llucax
Copy link
Contributor Author

llucax commented Feb 28, 2025

We also need to update the README.md build badge:

@llucax llucax linked a pull request Mar 29, 2025 that will close this issue
llucax added a commit that referenced this issue Mar 29, 2025
These new workflows also start using a new reusable `gh-action-nox`,
native arm runners and Ubuntu 24.04, as [Ubuntu 20.04 will be removed
from GitHub runners by April's
1st](https://github.blog/changelog/2025-01-15-github-actions-ubuntu-20-runner-image-brownout-dates-and-other-breaking-changes/
). Python 3.12 is also added to the test matrix.

The PR action is more lightweight, and only tests with one matrix (the
most widely used), so PRs can be tested more quickly.

The push workflow does a more intense testing with all matrix
combinations. This also runs for the merge queue, so before PRs are
actually merged the tests will run for the complete matrix.

Fixes #342, #341. Improves #59.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:ci Affects the GitHub workflow and other parts for running CI part:template Affects the cookiecutter template files type:enhancement New feature or enhancement visitble to users
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant