BUILD/MINOR: go.mod: update golang.org/x packages #722
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request] | |
jobs: | |
check: | |
if: ${{ github.event_name == 'pull_request' }} | |
name: HAProxy check commit message | |
runs-on: ubuntu-latest | |
steps: | |
- name: commit-check | |
uses: docker://ghcr.io/haproxytech/commit-check:3.0.0 | |
env: | |
API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
generate-specification: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.17 | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
id: go | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Compare | |
run: | | |
go run specification/build/build.go -file specification/haproxy-spec.yaml > specification/build/haproxy_spec_to_compare.yaml | |
diff -u specification/build/haproxy_spec_to_compare.yaml specification/build/haproxy_spec.yaml | |
- name: YAML script validation | |
run: | | |
chmod +x ./specification/scripts/lint-yaml.sh | |
./specification/scripts/lint-yaml.sh | |
generate-models: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: downloading Swagger | |
run: | | |
sudo wget -O /usr/local/bin/swagger https://github.com/go-swagger/go-swagger/releases/download/v0.23.0/swagger_linux_amd64 | |
sudo chmod +x /usr/local/bin/swagger | |
swagger version | |
- name: generating models | |
run: make models-native | |
- name: changes | |
run: test -z "$(git diff 2> /dev/null)" || exit "Models are not generated, issue \`make models\` and commit the result" | |
- name: untracked files | |
run: test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "Models generation created untracked files, cannot proceed" | |
lint: | |
name: golangci-lint | |
needs: ["generate-specification","generate-models"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: golangci-lint | |
uses: docker://ghcr.io/haproxytech/go-linter:1.43.0 | |
with: | |
args: --timeout 5m --max-issues-per-linter 0 --max-same-issues 0 | |
lint-spec: | |
needs: ["generate-specification","generate-models"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: yaml-lint | |
uses: ibiqlik/action-yamllint@master | |
with: | |
file_or_dir: . | |
config_file: .yamllint.yml | |
tidy: | |
name: go mod tidy | |
needs: ["generate-specification","generate-models"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: tidy | |
run: go mod tidy | |
- name: changes | |
run: test -z "$(git diff 2> /dev/null)" || exit "Go modules not tidied, issue \`go mod tidy\` and commit the result" | |
build: | |
name: Build | |
needs: ["generate-specification","generate-models"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.16 | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Build | |
run: | | |
go build -v . | |
go-test: | |
name: Tests | |
needs: ["tidy","build"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.17 | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Test | |
run: | | |
go test -v ./... | |
e2e: | |
name: e2e on HAProxy | |
needs: ["go-test"] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
haproxyVersion: [2.1, 2.2, 2.3, 2.4] | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v2 | |
- name: Build | |
uses: docker/build-push-action@v2 | |
with: | |
file: ./e2e/Dockerfile | |
build-args: | | |
HAPROXY_VERSION=${{ matrix.haproxyVersion }} | |
tags: client-native-test:${{ matrix.haproxyVersion }} | |
- uses: addnab/docker-run-action@v2 | |
with: | |
image: client-native-test:${{ matrix.haproxyVersion }} | |
run: go test -tags integration ./... |