Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 56 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: go build
name: build and test
on:
pull_request:
branches:
Expand All @@ -10,14 +10,64 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
id: go
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Verify dependencies
run: go mod verify
- name: Build
run: make build
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: dataplaneapi
path: build/dataplaneapi
retention-days: 1
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Test
run: make test
e2e:
name: HAProxy ${{ matrix.haproxy_version }} (${{ matrix.testpart }})
needs: build
strategy:
matrix:
haproxy_version: ["3.4"]
testpart: ["1/4", "2/4", "3/4", "4/4"]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install Bats
run: |
git clone --depth 1 --branch v1.10.0 https://github.com/bats-core/bats-core.git "$RUNNER_TEMP/bats-core"
sudo "$RUNNER_TEMP/bats-core/install.sh" /usr/local
- name: Download binary
uses: actions/download-artifact@v4
with:
name: dataplaneapi
path: build
- name: Run E2E tests
run: |
go build -v .
chmod +x build/dataplaneapi
bash ./e2e/run.bash
env:
HAPROXY_VERSION: ${{ matrix.haproxy_version }}
TESTPART: ${{ matrix.testpart }}
- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: e2e-logs-${{ strategy.job-index }}
path: e2e/logs/
6 changes: 5 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: commit-policy
uses: docker://ghcr.io/haproxytech/commit-check:5.0.4
uses: docker://ghcr.io/haproxytech/commit-check:5.8.1
env:
API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 0 additions & 24 deletions .github/workflows/e2e.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ on:
branches:
- master
jobs:
diff:
name: Generated code
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Install swagger
run: |
SWAGGER_VERSION=$(curl -fsSL https://raw.githubusercontent.com/haproxytech/client-native/master/Makefile | grep '^SWAGGER_VERSION=' | cut -d= -f2)
curl -fsSL "https://github.com/go-swagger/go-swagger/releases/download/${SWAGGER_VERSION}/swagger_linux_amd64" -o "$RUNNER_TEMP/swagger"
chmod +x "$RUNNER_TEMP/swagger"
printf '%s\n' "$RUNNER_TEMP" >> "$GITHUB_PATH"
- name: Generate code
run: |
make generate-native
make specification
- name: Check generated code
run: |
git diff --exit-code
test -z "$(git ls-files --others --exclude-standard)"
gofumpt:
name: gofumpt
runs-on: ubuntu-latest
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/vuln.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: govulncheck
on:
pull_request:
branches:
- master
jobs:
govulncheck:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Check vulnerabilities
run: govulncheck ./...
Loading