Skip to content

Enable and fix goconst linter #2538

Enable and fix goconst linter

Enable and fix goconst linter #2538

Workflow file for this run

name: CRI-O
on:
push:
tags:
- "*"
branches:
- master
pull_request:
jobs:
test:
strategy:
matrix:
suite:
- e2e
- critest
name: ${{matrix.suite}}
runs-on: ubuntu-22.04
steps:
- name: Install go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- name: Setup environment
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Cache go modules and build cache
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
'%LocalAppData%\go-build' # Windows
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- name: Setup system
run: |
# enable necessary kernel modules
sudo ip6tables --list >/dev/null
# enable necessary sysctls
sudo sysctl -w net.ipv4.conf.all.route_localnet=1
sudo sysctl -w net.bridge.bridge-nf-call-iptables=1
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -I POSTROUTING -s 127.0.0.0/8 ! -d 127.0.0.0/8 -j MASQUERADE
- name: Install ginkgo
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@latest
ginkgo version
sudo cp $(command -v ginkgo) /usr/local/bin
- name: Install CRI-O latest main
run: |
curl https://raw.githubusercontent.com/cri-o/packaging/main/get | sudo bash
- name: Configure and start CRI-O
run: |
sudo mkdir -p /etc/crio/crio.conf.d
printf '[crio.runtime]\nlog_level = "debug"\n' | sudo tee /etc/crio/crio.conf.d/01-log-level.conf
printf '[crio.runtime]\nseccomp_use_default_when_empty = false\n' | sudo tee /etc/crio/crio.conf.d/02-seccomp.conf
sudo systemctl daemon-reload
sudo systemctl start crio
- name: Checkout cri-tools for this commit
uses: actions/checkout@v4
with:
path: ${{github.workspace}}/src/github.com/kubernetes-sigs/cri-tools
- name: Build cri-tools
run: |
make
sudo -E PATH=$PATH make install
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools
- name: Run critest
if: ${{matrix.suite == 'critest'}}
run: |
sudo -E PATH=$PATH critest \
--runtime-endpoint=unix:///var/run/crio/crio.sock \
--ginkgo.flakeAttempts=3 \
--parallel=$(nproc)
sudo journalctl -u crio > cri-o.log
- name: Run crictl e2e tests
if: ${{matrix.suite == 'e2e'}}
run: |
sudo -E PATH=$PATH make test-e2e \
TESTFLAGS="-crictl-runtime-endpoint=unix://var/run/crio/crio.sock"
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools
- name: Upload CRI-O logs
uses: actions/upload-artifact@v4
with:
name: cri-o-${{matrix.version}}-${{github.sha}}.log
path: cri-o.log