git.iko.soy/typeable/oauth2-proxy
on master help sign in
ci: migrate to Github Actions, close #546 (#750)
dc7dbc5Shinebayar G
.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 @@
31- [#800](https://github.com/oauth2-proxy/oauth2-proxy/pull/800) Fix import path for v7 (@johejo)
31- [#800](https://github.com/oauth2-proxy/oauth2-proxy/pull/800) Fix import path for v7 (@johejo)
32- [#783](https://github.com/oauth2-proxy/oauth2-proxy/pull/783) Update Go to 1.15 (@johejo)
32- [#783](https://github.com/oauth2-proxy/oauth2-proxy/pull/783) Update Go to 1.15 (@johejo)
33- [#813](https://github.com/oauth2-proxy/oauth2-proxy/pull/813) Fix build (@thiagocaiubi)
33- [#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)
34
35
35# v6.1.1
36# v6.1.1
36
37
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