Merge pull request #894 from thebsdbox/manifest_fix #1422
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: For each commit and PR | |
on: | |
push: | |
pull_request: | |
env: | |
GO_VERSION: "1.21" | |
jobs: | |
validation: | |
runs-on: ubuntu-latest | |
name: Checks and linters | |
steps: | |
- name: Init | |
run: sudo apt-get update && sudo apt-get install -y build-essential golint && sudo sysctl fs.inotify.max_user_instances=8192 && sudo sysctl fs.inotify.max_user_watches=524288 | |
- name: Install golangci-lint | |
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: All checks | |
run: make check | |
unit-tests: | |
runs-on: ubuntu-latest | |
name: Unit tests | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Run tests | |
run: make unit-tests | |
integration-tests: | |
name: Integration tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Run tests | |
run: make integration-tests | |
e2e-tests: | |
runs-on: ubuntu-latest | |
name: E2E ARP tests | |
steps: | |
- name: Ensure fs wont cause issues | |
run: sudo sysctl fs.inotify.max_user_instances=8192 && sudo sysctl fs.inotify.max_user_watches=524288 | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Build image locally | |
run: make dockerx86Local | |
- name: Run Manifest generation tests | |
run: make manifest-test | |
- name: Run Control plane tests | |
run: make e2e-tests | |
- name: Run Control plane tests v1.29.0 onwards | |
run: make e2e-tests129 | |
service-e2e-tests: | |
runs-on: ubuntu-latest | |
name: E2E service tests | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Build image with iptables | |
run: make dockerx86ActionIPTables | |
- name: Run tests | |
run: DOCKERTAG=action make service-tests | |
image-vul-check: | |
runs-on: ubuntu-latest | |
name: Image vulnerability scan | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build image with iptables | |
run: make dockerx86ActionIPTables | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: 'plndr/kube-vip:action' | |
format: 'table' | |
exit-code: '1' | |
ignore-unfixed: true | |
vuln-type: 'os,library' | |
severity: 'CRITICAL,HIGH' | |