Skip to content

Commit e3437d6

Browse files
authored
Merge pull request #2095 from Adirio/enhance-gh-actions
🌱 Enhance GitHub actions CI
2 parents b789900 + 9abe27b commit e3437d6

File tree

1 file changed

+41
-22
lines changed

1 file changed

+41
-22
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,6 @@ jobs:
2222
version: v1.37 # Always uses the latest patch version.
2323
only-new-issues: true # Show only new issues if it's a pull request
2424

25-
testdata:
26-
name: Verify testdata directory
27-
needs: lint
28-
runs-on: ubuntu-latest
29-
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
30-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
31-
steps:
32-
- name: Clone the code
33-
uses: actions/checkout@v2
34-
- name: Setup Go
35-
uses: actions/setup-go@v2
36-
with:
37-
go-version: '1.15'
38-
# This step is needed as the following one tries to remove
39-
# kustomize for each test but has no permission to do so
40-
- name: Remove pre-installed kustomize
41-
run: sudo rm -f /usr/local/bin/kustomize
42-
- name: Verify testdata directory
43-
run: make check-testdata
44-
4525
test:
4626
name: Test for ${{ matrix.os }}
4727
needs: lint
@@ -68,8 +48,6 @@ jobs:
6848
coverage:
6949
name: Code coverage
7050
needs:
71-
- lint
72-
- testdata
7351
- test
7452
runs-on: ubuntu-latest
7553
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
@@ -87,3 +65,44 @@ jobs:
8765
uses: shogo82148/actions-goveralls@v1
8866
with:
8967
path-to-profile: coverage-all.out
68+
69+
testdata:
70+
name: Verify testdata directory
71+
needs: lint
72+
runs-on: ubuntu-latest
73+
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
74+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
75+
steps:
76+
- name: Clone the code
77+
uses: actions/checkout@v2
78+
- name: Setup Go
79+
uses: actions/setup-go@v2
80+
with:
81+
go-version: '1.15'
82+
# This step is needed as the following one tries to remove
83+
# kustomize for each test but has no permission to do so
84+
- name: Remove pre-installed kustomize
85+
run: sudo rm -f /usr/local/bin/kustomize
86+
- name: Verify testdata directory
87+
run: make check-testdata
88+
89+
debug:
90+
name: Debug failing workflows
91+
needs: # Add to this list every job in this workflow
92+
- lint
93+
- test
94+
- coverage
95+
- testdata
96+
runs-on: ubuntu-latest
97+
# Failed PRs are shown in their check but pushes are hard to notice so we create an issue
98+
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
99+
steps:
100+
- name: Print env and event
101+
uses: hmarr/[email protected]
102+
- name: Create issue
103+
uses: nashmaniac/[email protected]
104+
with:
105+
title: CI failed for ${{ github.sha }}
106+
token: ${{ secrets.GITHUB_TOKEN }}
107+
labels: kind/bug
108+
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

0 commit comments

Comments
 (0)