Feature/merge test #13
Workflow file for this run
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: Integration tests | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'release-*' | |
pull_request: | |
branches: | |
- 'master' | |
jobs: | |
check-go: | |
name: Ensure Go modules synchronicity | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Golang | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: Download all Go modules | |
run: | | |
go mod download | |
- name: Check for tidyness of go.mod and go.sum | |
run: | | |
go mod tidy | |
git diff --exit-code -- . | |
codegen: | |
name: Run codegen | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Kustomize v2 | |
run: | | |
set -xo pipefail | |
URL="https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.1.0/kustomize_v5.1.0_linux_amd64.tar.gz" | |
BINNAME=kustomize | |
curl -sLf --retry 3 -o /tmp/kustomize.tar.gz "$URL" | |
chksum=$(sha256sum /tmp/kustomize.tar.gz | awk '{ print $1; }') | |
if test "${chksum}" != "52f4cf1ba34d38fd55a9bef819e329c9a4561f5f57f8f539346038ab5026dda8"; then | |
echo "Checksum mismatch" >&2 | |
exit 1 | |
fi | |
tar -C /tmp -xvzf /tmp/kustomize.tar.gz | |
sudo mv /tmp/kustomize /usr/local/bin/kustomize | |
chmod +x /usr/local/bin/kustomize | |
- name: Run make manifests | |
run: | | |
make manifests | |
- name: Check nothing has changed | |
run: | | |
set -xo pipefail | |
git diff --exit-code -- . ':!go.sum' ':!go.mod' ':!assets/swagger.json' | tee codegen.patch | |
lint: | |
name: Ensure code is correctly linted | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.52.2 | |
args: --timeout 5m | |
test: | |
name: Ensure unit tests are passing | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Golang | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: Run tests | |
env: | |
GNUPG_DISABLED: true | |
run: | | |
make test | |
- name: Upload code coverage information to codecov.io | |
uses: codecov/codecov-action@v1 | |
with: | |
file: coverage.out |