Skip to content

Commit 3c989b6

Browse files
dploegerDennis Ploeger
authored andcommitted
chore: Only run cloud tests when not originating from a fork
1 parent 9bd7ee9 commit 3c989b6

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,30 @@ env:
77
GOSSVERSION: v0.4.4
88

99
jobs:
10+
notify:
11+
runs-on: ubuntu-latest
12+
if: ${{ github.event.pull_request.head.repo.fork }}
13+
steps:
14+
- name: Notifiy about skips on forks
15+
run: |
16+
echo "::notice title=Skipping cloud tests::Because we're running from a fork, we'll skip cloud tests."
17+
build-exclude:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
jobs: ${{ steps.build-exclude.outputs.jobs }}
21+
steps:
22+
- id: build-exclude
23+
run: |
24+
cat <<EOT > tmp.js
25+
exclude=[{"flavour": "tanzu", "arch": "linux/arm64"}]
26+
if (${{ github.event.pull_request.head.repo.fork }}) {
27+
exclude = exclude.concat([{"flavour": "aws"}, {"flavour": "azure"}, {"flavour": "gcloud"}])
28+
}
29+
console.log(JSON.stringify(exclude))
30+
EOT
31+
echo "jobs=$(node tmp.js)" >> "$GITHUB_OUTPUT"
1032
test:
33+
needs: build-exclude
1134
strategy:
1235
matrix:
1336
flavour:
@@ -21,12 +44,7 @@ jobs:
2144
- linux/amd64
2245
# Commented until Github supports arm64 runners
2346
#- linux/arm64
24-
exclude:
25-
- flavour: "azure"
26-
arch: "linux/arm64"
27-
- flavour: "tanzu"
28-
arch: "linux/arm64"
29-
47+
exclude: ${{ fromJSON(needs.build-exclude.outputs.jobs) }}
3048

3149
runs-on: ubuntu-latest
3250

0 commit comments

Comments
 (0)