You've already forked oauth2-proxy
							
							
				mirror of
				https://github.com/oauth2-proxy/oauth2-proxy.git
				synced 2025-10-30 23:47:52 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							
								
								
									
										28
									
								
								.github/workflows/ci.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								.github/workflows/ci.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -14,42 +14,46 @@ jobs: | ||||
|   build: | ||||
|     env: | ||||
|       COVER: true | ||||
|       GOPATH: ${{ github.workspace }} | ||||
|     runs-on: ubuntu-18.04 | ||||
|     steps: | ||||
|  | ||||
|     - name: Check out code into the Go module directory | ||||
|     - name: Check out code | ||||
|       uses: actions/checkout@v2 | ||||
|       with: | ||||
|         path: ./src/github.com/${{ github.repository }} | ||||
|  | ||||
|     - name: Set up Go 1.14 | ||||
|     - name: Set up Go 1.15 | ||||
|       uses: actions/setup-go@v2 | ||||
|       with: | ||||
|         go-version: ^1.14 | ||||
|         go-version: 1.15.x | ||||
|       id: go | ||||
|  | ||||
|     - name: Get dependencies | ||||
|       run: | | ||||
|         cd src/github.com/${{ github.repository }} | ||||
|         curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.24.0 | ||||
|         GO111MODULE=on go mod download | ||||
|         curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0 | ||||
|         go mod download | ||||
|         curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter | ||||
|         chmod +x ./cc-test-reporter | ||||
|  | ||||
|     - name: Lint | ||||
|       run: | | ||||
|         cd src/github.com/${{ github.repository }} | ||||
|         make lint | ||||
|  | ||||
|     - name: Build | ||||
|       run: | | ||||
|         cd src/github.com/${{ github.repository }} | ||||
|         make build | ||||
|  | ||||
|     - name: Test | ||||
|       env: | ||||
|         CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||||
|       run: | | ||||
|         cd src/github.com/${{ github.repository }} | ||||
|         ./test.sh | ||||
|  | ||||
|   docker: | ||||
|     runs-on: ubuntu-18.04 | ||||
|     steps: | ||||
|  | ||||
|     - name: Check out code | ||||
|       uses: actions/checkout@v2 | ||||
|  | ||||
|     - name: Docker Build | ||||
|       run: | | ||||
|         make docker | ||||
|   | ||||
| @@ -39,6 +39,7 @@ | ||||
| - [#801](https://github.com/oauth2-proxy/oauth2-proxy/pull/801) Update go-redis/redis to v8 (@johejo) | ||||
| - [#750](https://github.com/oauth2-proxy/oauth2-proxy/pull/750) ci: Migrate to Github Actions (@shinebayar-g) | ||||
| - [#829](https://github.com/oauth2-proxy/oauth2-proxy/pull/820) Rename test directory to testdata (@johejo) | ||||
| - [#819](https://github.com/oauth2-proxy/oauth2-proxy/pull/819) Improve CI (@johejo) | ||||
|  | ||||
| # v6.1.1 | ||||
|  | ||||
|   | ||||
| @@ -1,9 +1,6 @@ | ||||
| FROM golang:1.15-buster AS builder | ||||
| ARG VERSION | ||||
|  | ||||
| # Download tools | ||||
| RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0 | ||||
|  | ||||
| # Copy sources | ||||
| WORKDIR $GOPATH/src/github.com/oauth2-proxy/oauth2-proxy | ||||
|  | ||||
| @@ -23,7 +20,7 @@ COPY . . | ||||
| RUN VERSION=${VERSION} make build && touch jwt_signing_key.pem | ||||
|  | ||||
| # Copy binary to alpine | ||||
| FROM alpine:3.11 | ||||
| FROM alpine:3.12 | ||||
| COPY nsswitch.conf /etc/nsswitch.conf | ||||
| COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||||
| COPY --from=builder /go/src/github.com/oauth2-proxy/oauth2-proxy/oauth2-proxy /bin/oauth2-proxy | ||||
|   | ||||
| @@ -1,9 +1,6 @@ | ||||
| FROM golang:1.15-buster AS builder | ||||
| ARG VERSION | ||||
|  | ||||
| # Download tools | ||||
| RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0 | ||||
|  | ||||
| # Copy sources | ||||
| WORKDIR $GOPATH/src/github.com/oauth2-proxy/oauth2-proxy | ||||
|  | ||||
| @@ -23,7 +20,7 @@ COPY . . | ||||
| RUN VERSION=${VERSION} GOARCH=arm64 make build && touch jwt_signing_key.pem | ||||
|  | ||||
| # Copy binary to alpine | ||||
| FROM arm64v8/alpine:3.11 | ||||
| FROM arm64v8/alpine:3.12 | ||||
| COPY nsswitch.conf /etc/nsswitch.conf | ||||
| COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||||
| COPY --from=builder /go/src/github.com/oauth2-proxy/oauth2-proxy/oauth2-proxy /bin/oauth2-proxy | ||||
|   | ||||
| @@ -1,9 +1,6 @@ | ||||
| FROM golang:1.15-buster AS builder | ||||
| ARG VERSION | ||||
|  | ||||
| # Download tools | ||||
| RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0 | ||||
|  | ||||
| # Copy sources | ||||
| WORKDIR $GOPATH/src/github.com/oauth2-proxy/oauth2-proxy | ||||
|  | ||||
| @@ -23,7 +20,7 @@ COPY . . | ||||
| RUN VERSION=${VERSION} GOARCH=arm GOARM=6 make build && touch jwt_signing_key.pem | ||||
|  | ||||
| # Copy binary to alpine | ||||
| FROM arm32v6/alpine:3.11 | ||||
| FROM arm32v6/alpine:3.12 | ||||
| COPY nsswitch.conf /etc/nsswitch.conf | ||||
| COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||||
| COPY --from=builder /go/src/github.com/oauth2-proxy/oauth2-proxy/oauth2-proxy /bin/oauth2-proxy | ||||
|   | ||||
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @@ -10,7 +10,7 @@ REGISTRY ?= quay.io/oauth2-proxy | ||||
| GO_MAJOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1) | ||||
| GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2) | ||||
| MINIMUM_SUPPORTED_GO_MAJOR_VERSION = 1 | ||||
| MINIMUM_SUPPORTED_GO_MINOR_VERSION = 14 | ||||
| MINIMUM_SUPPORTED_GO_MINOR_VERSION = 15 | ||||
| GO_VERSION_VALIDATION_ERR_MSG = Golang version is not supported, please update to at least $(MINIMUM_SUPPORTED_GO_MAJOR_VERSION).$(MINIMUM_SUPPORTED_GO_MINOR_VERSION) | ||||
|  | ||||
| DOCKER_BUILD := docker build --build-arg VERSION=${VERSION} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user