diff --git a/.github/actions/common/action.yaml b/.github/actions/common/action.yaml new file mode 100644 index 00000000..31c94d2d --- /dev/null +++ b/.github/actions/common/action.yaml @@ -0,0 +1,23 @@ +name: "Common Steps" +runs: + using: "composite" + steps: + - name: Install build dependencies + # Install dependencies for building packages on pre-release Pythons + # jaraco/skeleton#161 + if: matrix.python == '3.14' && matrix.platform == 'ubuntu-latest' + run: | + sudo apt update + sudo apt install -y libxml2-dev libxslt-dev + shell: bash + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + allow-prereleases: true + - name: Install tox + run: python -m pip install tox + shell: bash + - name: Run + run: tox + shell: bash diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5841cc37..4d47f97e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -55,23 +55,9 @@ jobs: runs-on: ${{ matrix.platform }} continue-on-error: ${{ matrix.python == '3.14' }} steps: - - uses: actions/checkout@v4 - - name: Install build dependencies - # Install dependencies for building packages on pre-release Pythons - # jaraco/skeleton#161 - if: matrix.python == '3.14' && matrix.platform == 'ubuntu-latest' - run: | - sudo apt update - sudo apt install -y libxml2-dev libxslt-dev - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - allow-prereleases: true - - name: Install tox - run: python -m pip install tox - - name: Run - run: tox + - uses: actions/checkout@v4 + - name: Common + uses: ./.github/actions/common collateral: strategy: @@ -80,19 +66,20 @@ jobs: job: - diffcov - docs - runs-on: ubuntu-latest + python: + - "3.x" + platform: + - ubuntu-latest + env: + TOX_ENV: ${{ matrix.job }} + runs-on: ${{ matrix.platform }} + continue-on-error: ${{ matrix.python == '3.14' }} steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: 3.x - - name: Install tox - run: python -m pip install tox - - name: Eval ${{ matrix.job }} - run: tox -e ${{ matrix.job }} + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Common + uses: ./.github/actions/common check: # This job does nothing and is only used for the branch protection if: always()