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 8503ca720..91fc675aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,34 +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@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.11" - 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 @@ -49,7 +44,8 @@ jobs: if: always() needs: - - build + - build-python + - link-check runs-on: ubuntu-latest diff --git a/.github/workflows/translation.yml b/.github/workflows/translation.yml index 7cfae2991..c6f1e70f6 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] @@ -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