From b4af9e5f32b1fcc34a9d727d3f5a1daa3f3a6b4e Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Sun, 20 Dec 2020 17:07:18 +0200 Subject: [PATCH] Add build workflow Signed-off-by: Stefan Prodan --- .github/workflows/build.yaml | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..d65441d1c --- /dev/null +++ b/.github/workflows/build.yaml @@ -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 .