Skip to content

Commit 74e0835

Browse files
authored
Merge pull request #5 from stefanprodan/retest-action-v2
Add retest GH action
2 parents 0856aef + 0661378 commit 74e0835

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

.github/workflows/retest.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: retest
2+
3+
on:
4+
pull_request:
5+
types: [opened]
6+
issue_comment:
7+
types: [created]
8+
9+
jobs:
10+
unit:
11+
if: contains(github.event.comment.body, '/retest')
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
ref: ${{ github.event.pull_request.head.sha }}
18+
- name: Restore Go cache
19+
uses: actions/cache@v1
20+
with:
21+
path: ~/go/pkg/mod
22+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
23+
restore-keys: |
24+
${{ runner.os }}-go-
25+
- name: Setup Go
26+
uses: actions/setup-go@v2
27+
with:
28+
go-version: 1.14.x
29+
- name: Setup Kubebuilder
30+
uses: ./.github/actions/kubebuilder
31+
- name: Run tests
32+
run: make test
33+
env:
34+
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin
35+
- name: Check if working tree is dirty
36+
run: |
37+
if [[ $(git diff --stat) != '' ]]; then
38+
echo 'run make test and commit changes'
39+
exit 1
40+
fi

.github/workflows/test.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ on:
55
push:
66
branches:
77
- master
8-
issue_comment:
9-
types: [created]
108

119
jobs:
1210
unit:
13-
if: github.event_name == 'push' || github.event_name == 'pull_request' || contains(github.event.comment.body, '/retest')
1411
runs-on: ubuntu-latest
1512
steps:
1613
- name: Checkout

0 commit comments

Comments
 (0)