Skip to content

validation of CnfCertificationSuiteRun CR's spec fields #79

validation of CnfCertificationSuiteRun CR's spec fields

validation of CnfCertificationSuiteRun CR's spec fields #79

Workflow file for this run

name: Test Incoming Changes
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
CM_BIN: /usr/local/bin/checkmake
CM_URL_LINUX: https://github.com/mrtazz/checkmake/releases/download/0.2.2/checkmake-0.2.2.linux.amd64 # yamllint disable-line
jobs:
lint:
name: Run Linters and Vet
runs-on: ubuntu-latest
env:
SHELL: /bin/bash
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: 1.21.5
- name: Disable default go problem matcher
run: echo "::remove-matcher owner=go::"
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Extract dependent Pull Requests
uses: depends-on/depends-on-action@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install checkmake
run: |
curl --location --output $CM_BIN --silent $CM_URL_LINUX
chmod +x $CM_BIN
- name: Install Shfmt
uses: mfinelli/setup-shfmt@v3
- name: Golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.55
args: --timeout 10m0s
- name: Checkmake
run: checkmake --config=.checkmake Makefile
- name: Hadolint
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
recursive: true
# - name: Shfmt
# run: shfmt -d *.sh script
- name: Markdownlint
uses: nosborn/[email protected]
with:
files: .
- name: ShellCheck
uses: ludeeus/action-shellcheck@master
- name: Typos
uses: crate-ci/typos@master
- name: Yamllint
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml
- name: Go vet
run: make vet
test:
name: Build, install and test operator in a Kind cluster
runs-on: ubuntu-22.04
env:
SHELL: /bin/bash
KUBECONFIG: '/home/runner/.kube/config'
steps:
- name: Disable default go problem matcher
run: echo "::remove-matcher owner=go::"
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Build operator
run: ./scripts/ci/build.sh
- name: Removed unused docker images and go cache cleanup
run: |
df -h
docker rmi $(docker images -f "dangling=true" -q) || true
docker builder prune --all -f
go clean -modcache
df -h
# Create a Kind cluster for testing.
- name: Check out `cnf-certification-test-partner` repo
uses: actions/checkout@v4
with:
repository: test-network-function/cnf-certification-test-partner
path: cnf-certification-test-partner
- name: Bootstrap cluster, docker, and python
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 3
command: cd ${GITHUB_WORKSPACE}/cnf-certification-test-partner; make bootstrap-cluster && make bootstrap-docker-ubuntu-local && make bootstrap-python-ubuntu-local
- name: Run 'make rebuild-cluster'
uses: nick-fields/retry@v2
env:
SKIP_PRELOAD_IMAGES: true
with:
timeout_minutes: 15
max_attempts: 3
command: cd ${GITHUB_WORKSPACE}/cnf-certification-test-partner; make rebuild-cluster
- name: Run 'make install'
uses: nick-fields/retry@v2
env:
SKIP_PRELOAD_IMAGES: true
with:
timeout_minutes: 20
max_attempts: 3
command: cd ${GITHUB_WORKSPACE}/cnf-certification-test-partner; make install
- name: Install cert-manager to cluster
run: kubectl apply -f https://github.com/jetstack/cert-manager/releases/latest/download/cert-manager.yaml
- name: More cleanup
run: |
df -h
docker rmi $(docker images -f "dangling=true" -q) || true
docker builder prune --all -f
go clean -modcache
df -h
- name: Install operator in the Kind cluster
run: ./scripts/ci/deploy.sh
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
- name: Run simple smoke test.
run: ./scripts/ci/smoke_test.sh