intel-device-plugins-for-ku.../.github/workflows/ci.yaml
Ed Bartosh 477e7076fa CI: add triggers for the main branch
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-02-18 16:56:36 +02:00

124 lines
3.9 KiB
YAML

name: CI
on:
push:
branches:
- main
- master
- 'release-*'
pull_request:
branches:
- master
- main
- 'release-*'
env:
RUNC_VERSION: v1.0.0-rc93
GO_VERSION: 1.15.7
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install build dependencies needed for VPU plugin
run: |
sudo apt-get update
sudo apt-get -y install libusb-1.0-0-dev
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.36
args: --timeout 5m
build:
name: Build and check device plugins
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Set up environment
shell: bash
run: |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
echo "MOD_PATH=$(go env GOPATH)/pkg/mod" >> $GITHUB_ENV
- uses: actions/cache@v1
with:
path: ${{ env.MOD_PATH }}
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install build dependencies needed for VPU plugin
run: |
sudo apt-get update
sudo apt-get -y install libusb-1.0-0-dev
- run: make go-mod-tidy
- run: make BUILDTAGS=kerneldrv
- run: make test BUILDTAGS=kerneldrv
- run: make check-github-actions
- name: Codecov report
run: bash <(curl -s https://codecov.io/bash)
image:
name: Build image
runs-on: ubuntu-18.04
strategy:
matrix:
image:
- intel-fpga-admissionwebhook
- intel-fpga-initcontainer
- intel-gpu-initcontainer
- intel-gpu-plugin
- intel-fpga-plugin
- intel-qat-plugin
- intel-vpu-plugin
- intel-deviceplugin-operator
- intel-sgx-plugin
- intel-sgx-initcontainer
- intel-dsa-plugin
# Demo images
- crypto-perf
- dsa-accel-config-demo
- opae-nlb-demo
- openssl-qat-engine
- sgx-sdk-demo
- sgx-aesmd-demo
- ubuntu-demo-opencl
- ubuntu-demo-openvino
builder: [buildah, docker]
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
id: cache-vendor
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/go.sum') }}
- uses: actions/setup-go@v2
if: steps.cache-vendor.outputs.cache-hit != 'true'
with:
go-version: ${{ env.GO_VERSION }}
- run: make -e vendor
if: steps.cache-vendor.outputs.cache-hit != 'true'
- name: Install Buildah and RunC
if: matrix.builder == 'buildah'
run: |
sudo apt-get -qq -y purge podman containers-image buildah
. /etc/os-release
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${ID^}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${ID^}_${VERSION_ID}/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo apt-get update -qq
sudo apt-get -qq -y install buildah
echo -e '[registries.search]\nregistries = ["docker.io"]\n\n' | sudo tee /etc/containers/registries.conf
# install runc
sudo curl -L https://github.com/opencontainers/runc/releases/download/${RUNC_VERSION}/runc.amd64 -o /usr/bin/runc
sudo chmod +x /usr/bin/runc
- name: Build image
env:
IMAGE_NAME: ${{ matrix.image }}
BUILDER_NAME: ${{ matrix.builder }}
run: |
make ${IMAGE_NAME} BUILDER=${BUILDER_NAME}