Skip to content

Add tests for workloads & fix ignoring metadata.managedFields #201

Add tests for workloads & fix ignoring metadata.managedFields

Add tests for workloads & fix ignoring metadata.managedFields #201

Workflow file for this run

name: "Build"
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
pull-requests: read
env:
GO_VERSION: 1.23
jobs:
build:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- name: Set up GO ${{env.GO_VERSION}}.x
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
check-latest: true
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Build
run: make build
test:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- name: Set up GO ${{env.GO_VERSION}}.x
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
check-latest: true
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Run unit tests
run: make test
testacc:
strategy:
matrix:
k3s_version:
- v1.31.2-k3s1
- v1.30.6-k3s1
- v1.29.10-k3s1
- v1.28.15-k3s1
- v1.27.16-k3s1
- v1.26.15-k3s1
- v1.25.16-k3s4
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- name: Set up GO ${{env.GO_VERSION}}.x
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
check-latest: true
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Start k3s
run: make k3s-start
env:
K3S_VERSION: ${{ matrix.k3s_version }}
- name: Run acceptance tests
run: make testacc
- name: Stop k3s
run: make k3s-stop
test-all:
strategy:
matrix:
k3s_version:
- v1.31.2-k3s1
- v1.30.6-k3s1
- v1.29.10-k3s1
- v1.28.15-k3s1
- v1.27.16-k3s1
- v1.26.15-k3s1
- v1.25.16-k3s4
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- name: Set up GO ${{env.GO_VERSION}}.x
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
check-latest: true
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Run unit tests
run: make test
- name: Start k3s
run: make k3s-start
env:
K3S_VERSION: ${{ matrix.k3s_version }}
- name: Run acceptance tests
run: make testacc
- name: Stop k3s
run: make k3s-stop
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: build/*coverage.xml
badge: true
fail_below_min: true
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: '60 80'
fmtcheck:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- name: Set up GO ${{env.GO_VERSION}}.x
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
check-latest: true
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Format check
run: make fmtcheck
vet:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v4
- name: Set up GO ${{env.GO_VERSION}}.x
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
check-latest: true
- run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Setup Environment
run: make ci-build-setup
- name: Run vet
run: make vet
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up GO ${{env.GO_VERSION}}.x
uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
check-latest: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60