From 0df141752c42f1efefce2c48ca759d707e4ac76f Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Sat, 24 Sep 2022 12:14:17 -0400 Subject: [PATCH] update the invalidations tracking workflow --- .github/workflows/invalidations.yml | 43 +++++++++++++++++------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/invalidations.yml b/.github/workflows/invalidations.yml index 647200894..af4c15807 100644 --- a/.github/workflows/invalidations.yml +++ b/.github/workflows/invalidations.yml @@ -1,33 +1,40 @@ name: Invalidations -on: pull_request + +on: + pull_request: + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: always. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: evaluate: + # Only run on PRs to the default branch. + # In the PR trigger above branches can be specified only explicitly whereas this check should work for master, main, or any other default branch + if: github.base_ref == github.event.repository.default_branch runs-on: ubuntu-latest steps: - uses: julia-actions/setup-julia@v1 with: - version: 'nightly' - - uses: actions/checkout@v2 - - uses: julia-actions/julia-buildpkg@latest + version: '1' + - uses: actions/checkout@v3 + - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-invalidations@v1 id: invs_pr - - - uses: actions/checkout@v2 + + - uses: actions/checkout@v3 with: - ref: 'master' - - uses: julia-actions/julia-buildpkg@latest + ref: ${{ github.event.repository.default_branch }} + - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-invalidations@v1 - id: invs_master + id: invs_default - name: Report invalidation counts run: | - echo "Invalidations on master: ${{ steps.invs_master.outputs.total }} (${{ steps.invs_master.outputs.deps }} via deps)" - echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" - shell: bash - - name: PR doesn't increase number of invalidations - run: | - if (( ${{ steps.invs_pr.outputs.total }} > ${{ steps.invs_master.outputs.total }} )); then - exit 1 - fi - shell: bash + echo "Invalidations on default branch: ${{ steps.invs_default.outputs.total }} (${{ steps.invs_default.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY + echo "This branch: ${{ steps.invs_pr.outputs.total }} (${{ steps.invs_pr.outputs.deps }} via deps)" >> $GITHUB_STEP_SUMMARY + - name: Check if the PR does increase number of invalidations + if: steps.invs_pr.outputs.total > steps.invs_default.outputs.total + run: exit 1 \ No newline at end of file