git.iko.soy/typeable/oauth2-proxy
on master help sign in
Improve CI (#819)

* simplify github actions workflow no more GOPATH, update Go to 1.15.x * add script to install golangci-lint * drop support for Go 1.14 * check docker build in ci * update alpine linux to 3.12 * update CHANGELOG * fix golangci-lint installation Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>

commitf705d2b5d33ef7b18edc0716823454fcb548a55a authorMitsuo Heijo <mitsuo.heijo@gmail.com> dateThu 8 Oct 2020, 02:46 (6 years ago) parenta835fc5
6 files changed+21−25
.github/workflows/ci.yaml+16−12 CHANGELOG.md+1 Dockerfile+1−4 Dockerfile.arm64+1−4 Dockerfile.armv6+1−4 Makefile+1−1
.github/workflows/ci.yaml+16−12
@@ -14,42 +14,46 @@ jobs:
1414 build:
1515 env:
1616 COVER: true
17− GOPATH: ${{ github.workspace }}
1817 runs-on: ubuntu-18.04
1918 steps:
2019
21− - name: Check out code into the Go module directory
20+ - name: Check out code
2221 uses: actions/checkout@v2
23− with:
24− path: ./src/github.com/${{ github.repository }}
2522
26− - name: Set up Go 1.14
23+ - name: Set up Go 1.15
2724 uses: actions/setup-go@v2
2825 with:
29− go-version: ^1.14
26+ go-version: 1.15.x
3027 id: go
3128
3229 - name: Get dependencies
3330 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
31+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
32+ go mod download
3733 curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
3834 chmod +x ./cc-test-reporter
3935
4036 - name: Lint
4137 run: |
42− cd src/github.com/${{ github.repository }}
4338 make lint
4439
4540 - name: Build
4641 run: |
47− cd src/github.com/${{ github.repository }}
4842 make build
4943
5044 - name: Test
5145 env:
5246 CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
5347 run: |
54− cd src/github.com/${{ github.repository }}
5548 ./test.sh
49+
50+ docker:
51+ runs-on: ubuntu-18.04
52+ steps:
53+
54+ - name: Check out code
55+ uses: actions/checkout@v2
56+
57+ - name: Docker Build
58+ run: |
59+ make docker
CHANGELOG.md+1
@@ -39,6 +39,7 @@
3939- [#801](https://github.com/oauth2-proxy/oauth2-proxy/pull/801) Update go-redis/redis to v8 (@johejo)
4040- [#750](https://github.com/oauth2-proxy/oauth2-proxy/pull/750) ci: Migrate to Github Actions (@shinebayar-g)
4141- [#829](https://github.com/oauth2-proxy/oauth2-proxy/pull/820) Rename test directory to testdata (@johejo)
42+- [#819](https://github.com/oauth2-proxy/oauth2-proxy/pull/819) Improve CI (@johejo)
4243
4344# v6.1.1
4445
Dockerfile+1−4
@@ -1,9 +1,6 @@
11FROM golang:1.15-buster AS builder
22ARG VERSION
33
4−# Download tools
5−RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
6−
74# Copy sources
85WORKDIR $GOPATH/src/github.com/oauth2-proxy/oauth2-proxy
96
@@ -23,7 +20,7 @@ COPY . .
2320RUN VERSION=${VERSION} make build && touch jwt_signing_key.pem
2421
2522# Copy binary to alpine
26−FROM alpine:3.11
23+FROM alpine:3.12
2724COPY nsswitch.conf /etc/nsswitch.conf
2825COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
2926COPY --from=builder /go/src/github.com/oauth2-proxy/oauth2-proxy/oauth2-proxy /bin/oauth2-proxy
Dockerfile.arm64+1−4
@@ -1,9 +1,6 @@
11FROM golang:1.15-buster AS builder
22ARG VERSION
33
4−# Download tools
5−RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
6−
74# Copy sources
85WORKDIR $GOPATH/src/github.com/oauth2-proxy/oauth2-proxy
96
@@ -23,7 +20,7 @@ COPY . .
2320RUN VERSION=${VERSION} GOARCH=arm64 make build && touch jwt_signing_key.pem
2421
2522# Copy binary to alpine
26−FROM arm64v8/alpine:3.11
23+FROM arm64v8/alpine:3.12
2724COPY nsswitch.conf /etc/nsswitch.conf
2825COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
2926COPY --from=builder /go/src/github.com/oauth2-proxy/oauth2-proxy/oauth2-proxy /bin/oauth2-proxy
Dockerfile.armv6+1−4
@@ -1,9 +1,6 @@
11FROM golang:1.15-buster AS builder
22ARG VERSION
33
4−# Download tools
5−RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
6−
74# Copy sources
85WORKDIR $GOPATH/src/github.com/oauth2-proxy/oauth2-proxy
96
@@ -23,7 +20,7 @@ COPY . .
2320RUN VERSION=${VERSION} GOARCH=arm GOARM=6 make build && touch jwt_signing_key.pem
2421
2522# Copy binary to alpine
26−FROM arm32v6/alpine:3.11
23+FROM arm32v6/alpine:3.12
2724COPY nsswitch.conf /etc/nsswitch.conf
2825COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
2926COPY --from=builder /go/src/github.com/oauth2-proxy/oauth2-proxy/oauth2-proxy /bin/oauth2-proxy
Makefile+1−1
@@ -10,7 +10,7 @@ REGISTRY ?= quay.io/oauth2-proxy
1010GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
1111GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
1212MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1
13−MINIMUM_SUPPORTED_GO_MINOR_VERSION = 14
13+MINIMUM_SUPPORTED_GO_MINOR_VERSION = 15
1414GO_VERSION_VALIDATION_ERR_MSG = Golang version is not supported, please update to at least $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION).$(MINIMUM_SUPPORTED_GO_MINOR_VERSION)
1515
1616DOCKER_BUILD := docker build --build-arg VERSION=${VERSION}