From a21a073078425b163b9231d9a8203f3d6ae49582 Mon Sep 17 00:00:00 2001 From: David J Pugh <6003255+djpugh@users.noreply.github.com> Date: Mon, 1 May 2023 23:21:58 +0100 Subject: [PATCH] Aggregating artifacts separately --- .github/workflows/pipeline.yml | 59 ++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 7c2ae2b..9db9093 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -136,7 +136,7 @@ jobs: needs: - changes if: > - (needs.changes.outputs.config == 'true' || needs.changes.outputs.workflows == 'true') || + (needs.changes.outputs.src || needs.changes.outputs.tests || needs.changes.outputs.config || needs.changes.outputs.workflows) || (github.event_name == 'pull_request' && contains(github.base_ref, 'main')) || (github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || contains(github.ref, 'main'))) || (github.event_name == 'release') @@ -177,13 +177,41 @@ jobs: name: wheels-${{matrix.os}}-${{matrix.py}} path: | ./wheels/* + aggregate: + name: Aggregate + runs-on: ubuntu-latest + needs: + - changes + - collate-packages + if: > + (needs.changes.outputs.src || needs.changes.outputs.tests || needs.changes.outputs.config || needs.changes.outputs.workflows) || + (github.event_name == 'pull_request' && contains(github.base_ref, 'main')) || + (github.event_name == 'push' && (startsWith(github.ref, 'refs/tags') || contains(github.ref, 'main'))) || + (github.event_name == 'release') + steps: + - name: Download collated wheels + uses: actions/download-artifact@v3 + with: + path: artifacts + - shell: bash + run: | + mkdir wheels + cp artifacts/*/*.whl wheels/ + ls -l wheels/ + - name: Store collated wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: | + ./wheels/* + test: name: Test Python ${{ matrix.py }} - ${{ matrix.os }} - ${{matrix.tox_version}} runs-on: ${{ matrix.os }}-latest needs: - changes - - collate-packages + - aggregate if: > (needs.changes.outputs.src || needs.changes.outputs.tests || needs.changes.outputs.config || needs.changes.outputs.workflows) || (github.event_name == 'pull_request' ) || @@ -220,11 +248,8 @@ jobs: - name: Download collated wheels uses: actions/download-artifact@v3 with: - path: wheels - - shell: bash - run: | - cp wheels/*/*.whl src/azure_devops_artifacts_helpers/wheels/ - ls -l src/azure_devops_artifacts_helpers/wheels/ + name: wheels + path: src/azure_devops_artifacts_helpers/wheels/ - name: Setup Test Suite run: tox -e test-${{ matrix.tox_version }} -vv --notest - name: Run Test Suite @@ -332,7 +357,7 @@ jobs: name: Build Package runs-on: windows-latest needs: - - collate-packages + - aggregate - changes if: > (needs.changes.outputs.src || needs.changes.outputs.config || needs.changes.outputs.workflows) || @@ -357,12 +382,8 @@ jobs: - name: Download collated wheels uses: actions/download-artifact@v3 with: - path: wheels - - - shell: bash - run: | - cp -u wheels/*/*.whl src/azure_devops_artifacts_helpers/wheels/ - ls -l src/azure_devops_artifacts_helpers/wheels/ + name: wheels + path: src/azure_devops_artifacts_helpers/wheels/ - name: Build azure_devops_artifacts_helpers run: tox -e build -vvv @@ -376,7 +397,7 @@ jobs: docs: name: Build docs needs: - - collate-packages + - aggregate - changes if: > (needs.changes.outputs.src || needs.changes.outputs.config || needs.changes.outputs.docs || needs.changes.outputs.workflows) || @@ -392,16 +413,12 @@ jobs: run: | python -m pip install --upgrade pip pip install tox - - name: Download collated wheels uses: actions/download-artifact@v3 with: - path: wheels + name: wheels + path: src/azure_devops_artifacts_helpers/wheels/ - - shell: bash - run: | - cp -u wheels/*/*.whl src/azure_devops_artifacts_helpers/wheels/ - ls -l src/azure_devops_artifacts_helpers/wheels/ - name: Build docs run: tox -e docs env: