-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.05 KB
/
test-manifests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Run manifest tests
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
# Check if there were any changes in the cluster chart
check-changes:
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.detect_changes.outputs.changes }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for changes in helm/cluster
id: detect_changes
run: |
if git diff --name-only origin/main ${{ github.event.pull_request.head.sha }} | grep '^helm/cluster/'; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
# Run manifest tests only if there were changes in the cluster chart
test:
runs-on: ubuntu-latest
needs: check-changes
if: needs.check-changes.outputs.changes == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
- name: Run tests
run: |
make test