From dccd904867fbc8ee4f1da67bdaa741b0ab0015cd Mon Sep 17 00:00:00 2001 From: alexweininger Date: Fri, 29 Sep 2023 15:09:51 -0400 Subject: [PATCH 1/8] Try to fix CI for when no packages are changed --- .github/workflows/packages.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 4f13333b49..5244bdacd1 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -45,8 +45,10 @@ jobs: # Require all jobs under `build` to have succeeded # See https://github.com/orgs/community/discussions/26822 if: ${{ always() }} - needs: [Build] + needs: [Build, ChangedPackages] runs-on: ubuntu-latest steps: + - run: exit 0 + if: ${{ needs.ChangedPackages.outputs.packages[0] != null }} - run: exit 1 if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} From b9d3cdfe8b48691f52781977a41a1a8996128b15 Mon Sep 17 00:00:00 2001 From: alexweininger Date: Fri, 29 Sep 2023 15:11:04 -0400 Subject: [PATCH 2/8] Fixup --- .github/workflows/packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 5244bdacd1..4ab78a0b8f 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -49,6 +49,6 @@ jobs: runs-on: ubuntu-latest steps: - run: exit 0 - if: ${{ needs.ChangedPackages.outputs.packages[0] != null }} + if: ${{ needs.ChangedPackages.outputs.packages[0] == null }} - run: exit 1 if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} From 4402f1d67a8f6cf50cb3acff9c173c0d5ca13794 Mon Sep 17 00:00:00 2001 From: alexweininger Date: Fri, 29 Sep 2023 15:13:56 -0400 Subject: [PATCH 3/8] Try this --- .github/workflows/packages.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 4ab78a0b8f..a789cb8145 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -44,11 +44,9 @@ jobs: CheckResults: # TODO: this will fail if no packages have been modified # Require all jobs under `build` to have succeeded # See https://github.com/orgs/community/discussions/26822 - if: ${{ always() }} + if: ${{ needs.ChangedPackages.outputs.packages[0] != null }} needs: [Build, ChangedPackages] runs-on: ubuntu-latest steps: - - run: exit 0 - if: ${{ needs.ChangedPackages.outputs.packages[0] == null }} - run: exit 1 if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} From 8bfdd0bd85764194f32d5b6828bf35ee30932df7 Mon Sep 17 00:00:00 2001 From: alexweininger Date: Fri, 29 Sep 2023 15:15:23 -0400 Subject: [PATCH 4/8] Remove comment --- .github/workflows/packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index a789cb8145..7fcb46251e 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -41,7 +41,7 @@ jobs: matrix: package: ${{ fromJson(needs.ChangedPackages.outputs.packages) }} - CheckResults: # TODO: this will fail if no packages have been modified + CheckResults: # Require all jobs under `build` to have succeeded # See https://github.com/orgs/community/discussions/26822 if: ${{ needs.ChangedPackages.outputs.packages[0] != null }} From 47784fa2f3b5e457916a3e643345fa0a549a2678 Mon Sep 17 00:00:00 2001 From: alexweininger Date: Fri, 29 Sep 2023 15:43:35 -0400 Subject: [PATCH 5/8] Fix --- .github/workflows/packages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 7fcb46251e..75eb04c6b9 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -32,6 +32,7 @@ jobs: packages: ${{ steps.filter.outputs.changes }} Build: + if: ${{ fromJson(needs.ChangedPackages.outputs.packages)[0] != null }} # Use template from https://github.com/microsoft/vscode-azuretools/blob/main/.github/workflows/jobs.yml uses: ./.github/workflows/jobs.yml needs: [ChangedPackages] @@ -44,8 +45,7 @@ jobs: CheckResults: # Require all jobs under `build` to have succeeded # See https://github.com/orgs/community/discussions/26822 - if: ${{ needs.ChangedPackages.outputs.packages[0] != null }} - needs: [Build, ChangedPackages] + needs: [Build] runs-on: ubuntu-latest steps: - run: exit 1 From fbff8babec0d4f05c6a16198bddb8d0601aa43e6 Mon Sep 17 00:00:00 2001 From: alexweininger Date: Fri, 29 Sep 2023 15:45:39 -0400 Subject: [PATCH 6/8] Remove CheckResults job --- .github/workflows/packages.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 75eb04c6b9..7b6f95549d 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -41,12 +41,3 @@ jobs: strategy: matrix: package: ${{ fromJson(needs.ChangedPackages.outputs.packages) }} - - CheckResults: - # Require all jobs under `build` to have succeeded - # See https://github.com/orgs/community/discussions/26822 - needs: [Build] - runs-on: ubuntu-latest - steps: - - run: exit 1 - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} From 39779e287d03a2e53c179d50409f9d0bc46dcb46 Mon Sep 17 00:00:00 2001 From: alexweininger Date: Fri, 29 Sep 2023 16:02:04 -0400 Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=A4=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/packages.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 7b6f95549d..7e06f5e633 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -41,3 +41,13 @@ jobs: strategy: matrix: package: ${{ fromJson(needs.ChangedPackages.outputs.packages) }} + + CheckResults: # required for GtiHub PR rules + # Require all jobs under `build` to have succeeded + # See https://github.com/orgs/community/discussions/26822 + if: always() + needs: [Build, ChangedPackages] + runs-on: ubuntu-latest + steps: + - run: exit 1 + if: ${{ (fromJson(needs.ChangedPackages.outputs.packages)[0] != null) && contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} From 5e03c1d34990fd9d39b5d2cf52ddbbea2d4e62dd Mon Sep 17 00:00:00 2001 From: alexweininger Date: Fri, 29 Sep 2023 16:05:47 -0400 Subject: [PATCH 8/8] Fix --- .github/workflows/packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index 7e06f5e633..1f6eb24664 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -45,7 +45,7 @@ jobs: CheckResults: # required for GtiHub PR rules # Require all jobs under `build` to have succeeded # See https://github.com/orgs/community/discussions/26822 - if: always() + if: ${{ always() }} needs: [Build, ChangedPackages] runs-on: ubuntu-latest steps: