mirror of
https://github.com/rancher/k3k.git
synced 2026-08-19 12:26:17 +00:00
* wip drop dapper * added tests, validate * fix kubebuilder assets * debug * fix maybe * export global * export global 2 * fix goreleaser * dev doc section improved * crd and docs * drop dapper * drop unused tmpl * added help * typos, and added `build-crds` target to default
93 lines
1.6 KiB
YAML
93 lines
1.6 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v6
|
|
with:
|
|
args: --timeout=5m
|
|
version: v1.60
|
|
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Validate
|
|
run: make validate
|
|
|
|
- name: Run unit tests
|
|
run: make test-unit
|
|
|
|
tests-e2e:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
fetch-tags: true
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Validate
|
|
run: make validate
|
|
|
|
- name: Install Ginkgo
|
|
run: go install github.com/onsi/ginkgo/v2/ginkgo
|
|
|
|
- name: Build and package
|
|
run: |
|
|
make build
|
|
make package
|
|
|
|
# add k3kcli to $PATH
|
|
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
|
|
|
|
- name: Check k3kcli
|
|
run: k3kcli -v
|
|
|
|
- name: Run e2e tests
|
|
run: make test-e2e
|
|
|
|
- name: Archive k3s logs
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: k3s-logs
|
|
path: /tmp/k3s.log
|
|
|
|
- name: Archive k3k logs
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: k3k-logs
|
|
path: /tmp/k3k.log
|