-
Notifications
You must be signed in to change notification settings - Fork 741
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stefan Prodan <[email protected]>
- Loading branch information
1 parent
3ba2762
commit b4af9e5
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: build | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- github-actions | ||
|
||
jobs: | ||
container: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Restore Go cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15.x | ||
- name: Run tests | ||
run: make test | ||
- name: Check if working tree is dirty | ||
run: | | ||
if [[ $(git diff --stat) != '' ]]; then | ||
git --no-pager diff | ||
echo 'run make test and commit changes' | ||
exit 1 | ||
fi | ||
- name: Build container image | ||
run: docker build -t test/flagger:latest . |