Skip to content

make check updates to cope with oldest stable version go1.22 #1055

make check updates to cope with oldest stable version go1.22

make check updates to cope with oldest stable version go1.22 #1055

Workflow file for this run

name: CI
# Run tests on pull requests and when changes are directly
# committed to master.
on:
push:
branches: [master, release]
pull_request:
branches: [master]
jobs:
# Do a build/compile smoke test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: oldstable
- uses: actions/checkout@v4
- name: Build
run: make
# Run static/code-quality checks
check:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: oldstable
- uses: actions/checkout@v4
- name: Install revive
run: go install github.com/mgechev/revive@latest
- name: Run checks
run: make check
check-commits:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Ensure branches
run: git fetch
- name: Lint git commit messages
run: make check-gitlint
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: oldstable
- uses: actions/checkout@v4
- name: run the tests
run: make test
podmanbuild:
runs-on: ubuntu-20.04
# don't run on push, since the "push" job contains the
# image build step, so no need to do it twice.
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Install fuse-overlayfs
run: sudo apt-get -y install fuse-overlayfs
- name: Setup podman config
run: |
mkdir -p /home/runner/.config/containers/
cat >/home/runner/.config/containers/storage.conf <<EOF
[storage]
driver = "overlay"
graphroot = "${HOME}/.local/share/containers/storage2"
[storage.options]
mount_program = "/usr/bin/fuse-overlayfs"
EOF
cat >/home/runner/.config/containers/containers.conf <<EOF
[containers]
netns = "host"
EOF
- name: build container image
# note: forcing use of podman here since we are
# using podman explicitly for the push job
run: make CONTAINER_CMD=podman image-build
dockerbuild:
runs-on: ubuntu-latest
# don't run on push, since the "push" job contains the
# image build step, so no need to do it twice.
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: build container image
# note: forcing use of podman here since we are
# using podman explicitly for the push job
run: make CONTAINER_CMD=docker image-build
test-kubernetes:
#runs-on: ubuntu-latest
# need to explicitly use 20.04 to avoid problems with jq...
runs-on: ubuntu-20.04
env:
CONTAINER_CMD: docker
PR_NUM: ${{ github.event.pull_request.number }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: oldstable
- name: Install k3d
run: curl -L --silent --fail "https://raw.githubusercontent.com/rancher/k3d/main/install.sh" | bash
# The TAG env var can interfere with the k3d install script.
# Env vars must be set up *after* k3d is installed.
- name: Set environment vars
run: |
tag="latest-scratch"
if [ "${PR_NUM}" ] ; then tag="pr-${PR_NUM}" ; fi
reg_base="registry.localhost"
reg_port="5000"
reg="k3d-${reg_base}:${reg_port}"
img="${reg}/samba.org/samba-operator:${tag}"
{
# registry params
echo "REG_BASE=${reg_base}"
echo "REG_PORT=${reg_port}"
echo "REGISTRY=${reg}"
# tag and image name for build+push
echo "TAG=${tag}"
echo "IMG=${img}"
# operator image for verification by test suite
echo "SMBOP_TEST_EXPECT_MANAGER_IMG=${img}"
} >> $GITHUB_ENV
- name: Create k3d registry
run: k3d registry create "${REG_BASE}" --port "${REG_PORT}"
- name: Create k3d cluster
run: k3d cluster create --wait --image docker.io/rancher/k3s:v1.21.5-k3s1 --registry-use "${REGISTRY}"
- name: Wait for cluster ready
run: |
while ! kubectl get serviceaccount default >/dev/null; do sleep 1; done
- name: get nodes
run: kubectl get nodes
- name: deploy ad server
run: ./tests/test-deploy-ad-server.sh
- name: build image
run: make image-build
- name: push image to k3d registry
run: make container-push
- name: configure kustomize
run: make set-image
- name: run tests
run: ./tests/test.sh
- name: dump logging on failure
if: ${{ failure() }}
run: ./tests/post-test-info.sh
# push the container to quay.io - only for pushes, not PRs
push:
needs: [build, check]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- name: log in to quay.io
# using docker for now, since podman has an issue with space
# consumption: image build fails with no space left on device...
run: echo "${{ secrets.QUAY_PASS }}" | docker login -u "${{ secrets.QUAY_USER }}" --password-stdin quay.io
- name: build container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker image-build
- name: push container image
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker container-push