git.iko.soy/typeable/oauth2-proxy
on master help sign in
ci: migrate to Github Actions, close #546 (#750)

* ci: migrate to Github Actions * ci: optimize on feedback * ci: run gocov in correct dir * ci: running after-build script always * ci: giving test script execute permission * ci: correct error handling on test script * ci: more verbose test script * ci: configure CC_TEST_REPORTER_ID env * ci: check existence of CC_TEST_REPORT_ID variable, skip if unset * ci: check existence of CC_TEST_REPORT_ID variable, skip if unset * update changelog * Update CHANGELOG.md Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>

commitdc7dbc5d286be384cca118fe7c686c54f1759515 authorShinebayar G <3091558+shinebayar-g@users.noreply.github.com> dateMon 5 Oct 2020, 04:29 (6 years ago) parent8be97f2
3 files changed+83
.github/workflows/ci.yaml+55 CHANGELOG.md+1 test.sh+27
.github/workflows/ci.yamlnew file+55
@@ -0,0 +1,55 @@
1+name: Continuous Integration
2+
3+on:
4+ push:
5+ branches:
6+ - '**'
7+ # - $default-branch
8+ pull_request:
9+ branches:
10+ - '**'
11+ # - $default-branch
12+
13+jobs:
14+ build:
15+ env:
16+ COVER: true
17+ GOPATH: ${{ github.workspace }}
18+ runs-on: ubuntu-18.04
19+ steps:
20+
21+ - name: Check out code into the Go module directory
22+ uses: actions/checkout@v2
23+ with:
24+ path: ./src/github.com/${{ github.repository }}
25+
26+ - name: Set up Go 1.14
27+ uses: actions/setup-go@v2
28+ with:
29+ go-version: ^1.14
30+ id: go
31+
32+ - name: Get dependencies
33+ run: |
34+ cd src/github.com/${{ github.repository }}
35+ curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.24.0
36+ GO111MODULE=on go mod download
37+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
38+ chmod +x ./cc-test-reporter
39+
40+ - name: Lint
41+ run: |
42+ cd src/github.com/${{ github.repository }}
43+ make lint
44+
45+ - name: Build
46+ run: |
47+ cd src/github.com/${{ github.repository }}
48+ make build
49+
50+ - name: Test
51+ env:
52+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
53+ run: |
54+ cd src/github.com/${{ github.repository }}
55+ ./test.sh
CHANGELOG.md+1
@@ -31,6 +31,7 @@
3131- [#800](https://github.com/oauth2-proxy/oauth2-proxy/pull/800) Fix import path for v7 (@johejo)
3232- [#783](https://github.com/oauth2-proxy/oauth2-proxy/pull/783) Update Go to 1.15 (@johejo)
3333- [#813](https://github.com/oauth2-proxy/oauth2-proxy/pull/813) Fix build (@thiagocaiubi)
34+- [#750](https://github.com/oauth2-proxy/oauth2-proxy/pull/750) ci: Migrate to Github Actions (@shinebayar-g)
3435
3536# v6.1.1
3637
test.shnew file+27
@@ -0,0 +1,27 @@
1+#!/bin/bash
2+# manually exiting from script, because after-build needs to run always
3+set +e
4+
5+if [ -z $CC_TEST_REPORT_ID ]; then
6+ echo "1. CC_TEST_REPORT_ID is unset, skipping"
7+else
8+ echo "1. Running before-build"
9+ ./cc-test-reporter before-build
10+fi
11+
12+echo "2. Running test"
13+make test
14+TEST_STATUS=$?
15+echo "TEST_STATUS: ${TEST_STATUS}"
16+
17+if [ -z $CC_TEST_REPORT_ID ]; then
18+ echo "3. CC_TEST_REPORT_ID is unset, skipping"
19+else
20+ echo "3. Running after-build"
21+ ./cc-test-reporter after-build --exit-code $TEST_STATUS -t gocov
22+fi
23+
24+if [ "$TEST_STATUS" -ne 0 ]; then
25+ echo "Test failed, status code: $TEST_STATUS"
26+ exit $TEST_STATUS
27+fi