Skip to content

Add SRIOV Operator CI lane #429

Add SRIOV Operator CI lane

Add SRIOV Operator CI lane #429

Workflow file for this run

#Originally from https://raw.githubusercontent.com/intel/multus-cni/master/.github/workflows/go-build-test-amd64.yml
name: Go-build-and-test-amd64
on:
push:
pull_request:
schedule:
- cron: "0 8 * * 0" # every sunday
jobs:
build-test:
strategy:
matrix:
go-version: [1.20.x]
os: [ubuntu-latest]
goos: [linux]
goarch: [amd64, arm64, ppc64le]
runs-on: ${{ matrix.os }}
env:
GO111MODULE: on
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Build test for ${{ matrix.goarch }}
env:
GOARCH: ${{ matrix.goarch }}
GOOS: ${{ matrix.goos }}
run: GOARCH="${TARGET}" go build ./cmd/sriov/...
- name: Go test
if: ${{ matrix.goarch }} == "amd64"
run: sudo go test -race ./... # sudo needed for netns change in test
coverage:
runs-on: ubuntu-latest
needs: build-test
name: coverage
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.x
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Go test with coverage
run: sudo make test-coverage # sudo needed for netns change in test
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: test/coverage/lcov.info
build-and-push-amd64-sriov-cni-on-pr:
name: PR Image Push AMD64
runs-on: [ sriov ]
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push sriov-cni
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64
tags: |
ghaction-sriov-cni:pr-${{github.event.pull_request.number}}
file: ./Dockerfile
virtual-k8s-cluster:
name: sriov operator k8s tests
needs: [ build-test,build-and-push-amd64-sriov-cni-on-pr ]
runs-on: [ sriov ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
repository: https://github.com/k8snetworkplumbingwg/sriov-network-operator
ref: e2e-inject-images
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: run test
run: make test-e2e-conformance-virtual-k8s-cluster-ci
env:
LOCAL_SRIOV_CNI_IMAGE=ghaction-sriov-cni:pr-${{github.event.pull_request.number}}
- uses: actions/upload-artifact@v3
if: always()
with:
name: k8s-artifact
path: ./k8s-artifacts