From 96a126fcb4bb9baa1a298a45baa1617a1bb9daa6 Mon Sep 17 00:00:00 2001 From: CJ Steiner Date: Tue, 7 Jan 2025 03:46:58 -0600 Subject: [PATCH 1/3] ci: update checkout to v4 --- .github/workflows/test.yml | 2 +- .github/workflows/translation.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8503ca720..7e5c4ce62 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: - linkcheck steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 diff --git a/.github/workflows/translation.yml b/.github/workflows/translation.yml index 7cfae2991..e27a549e9 100644 --- a/.github/workflows/translation.yml +++ b/.github/workflows/translation.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Grab the repo src - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # To reach the common commit - name: Set up git user as [bot] From 855bbd4da3bcc01d7bf931ec75c86e6536aca538 Mon Sep 17 00:00:00 2001 From: CJ Steiner Date: Tue, 7 Jan 2025 03:51:10 -0600 Subject: [PATCH 2/3] ci: add in matrix builds for python ut, caching for python setup, bump python setup version to 5 --- .github/workflows/test.yml | 5 +++-- .github/workflows/translation.yml | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7e5c4ce62..55e2246e3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: + python: ['3.9', '3.10', '3.11', '3.12', '3.13'] noxenv: - build - linkcheck @@ -27,9 +28,9 @@ jobs: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: ${{ matrix.python }} cache: 'pip' cache-dependency-path: 'requirements.txt' diff --git a/.github/workflows/translation.yml b/.github/workflows/translation.yml index e27a549e9..c6f1e70f6 100644 --- a/.github/workflows/translation.yml +++ b/.github/workflows/translation.yml @@ -51,10 +51,12 @@ jobs: git merge '${{ github.event.repository.default_branch }}' - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: >- 3.10 + cache: 'pip' + cache-dependency-path: 'requirements.txt' - name: Install Python tooling run: python -m pip install --upgrade nox virtualenv From 874318f93e97648c126352c27901d83cba2e49e7 Mon Sep 17 00:00:00 2001 From: CJ Steiner Date: Tue, 7 Jan 2025 04:21:48 -0600 Subject: [PATCH 3/3] ci: update to generic gha for build step --- .github/workflows/build.yml | 33 +++++++++++++++++++++++++++++ .github/workflows/test.yml | 41 ++++++++++++++++--------------------- 2 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..e60798637 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: reusable build step + +on: + workflow_call: + inputs: + python-version: + required: true + type: string + nox-env: + required: true + type: string +jobs: + build: + name: ${{ inputs.nox-env }} + if: ${{ github.repository_owner == 'pypa' || github.event_name != 'schedule' }} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + cache: 'pip' + cache-dependency-path: 'requirements.txt' + + - name: Install dependencies + run: | + python -m pip install --upgrade nox virtualenv + + - name: Nox ${{ matrix.noxenv }} + run: | + python -m nox -s ${{ inputs.nox-env }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55e2246e3..91fc675aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,35 +13,29 @@ concurrency: cancel-in-progress: true jobs: - build: - name: ${{ matrix.noxenv }} - if: ${{ github.repository_owner == 'pypa' || github.event_name != 'schedule' }} - runs-on: ubuntu-latest + + build-python: strategy: matrix: python: ['3.9', '3.10', '3.11', '3.12', '3.13'] noxenv: - build - - linkcheck - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - cache: 'pip' - cache-dependency-path: 'requirements.txt' + uses: ./.github/workflows/build.yml + with: + python-version: ${{ matrix.python }} + nox-env: ${{ matrix.noxenv }} - - name: Install dependencies - run: | - python -m pip install --upgrade nox virtualenv - - - name: Nox ${{ matrix.noxenv }} - run: | - python -m nox -s ${{ matrix.noxenv }} + link-check: + strategy: + matrix: + python: ['3.11'] + noxenv: + - linkcheck + uses: ./.github/workflows/build.yml + with: + python-version: ${{ matrix.python }} + nox-env: ${{ matrix.noxenv }} check: # This job does nothing and is only used for the branch protection @@ -50,7 +44,8 @@ jobs: if: always() needs: - - build + - build-python + - link-check runs-on: ubuntu-latest