Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Enhance GitHub actions CI
Signed-off-by: Adrian Orive <[email protected]>
  • Loading branch information
Adirio committed Mar 23, 2021
commit 9abe27bd087382dd427dcc3523d9aa0bf250a518
63 changes: 41 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,6 @@ jobs:
version: v1.37 # Always uses the latest patch version.
only-new-issues: true # Show only new issues if it's a pull request

testdata:
name: Verify testdata directory
needs: lint
runs-on: ubuntu-latest
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Clone the code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15'
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
- name: Remove pre-installed kustomize
run: sudo rm -f /usr/local/bin/kustomize
- name: Verify testdata directory
run: make check-testdata

test:
name: Test for ${{ matrix.os }}
needs: lint
Expand All @@ -68,8 +48,6 @@ jobs:
coverage:
name: Code coverage
needs:
- lint
- testdata
- test
runs-on: ubuntu-latest
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
Expand All @@ -87,3 +65,44 @@ jobs:
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage-all.out

testdata:
name: Verify testdata directory
needs: lint
runs-on: ubuntu-latest
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Clone the code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15'
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
- name: Remove pre-installed kustomize
run: sudo rm -f /usr/local/bin/kustomize
- name: Verify testdata directory
run: make check-testdata

debug:
name: Debug failing workflows
needs: # Add to this list every job in this workflow
- lint
- test
- coverage
- testdata
runs-on: ubuntu-latest
# Failed PRs are shown in their check but pushes are hard to notice so we create an issue
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Print env and event
uses: hmarr/[email protected]
- name: Create issue
uses: nashmaniac/[email protected]
with:
title: CI failed for ${{ github.sha }}
token: ${{ secrets.GITHUB_TOKEN }}
labels: kind/bug
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}