Skip to content

Update Dockerfile

Update Dockerfile #75

Workflow file for this run

# (C) Copyright Confidential Containers Contributors
# # SPDX-License-Identifier: Apache-2.0
#
# Build binary and run unit tests
---
name: build
on:
pull_request:
workflow_dispatch:
jobs:
build_job:
name: build
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
type:
- dev
- release
runner:
- ubuntu-latest
go_version:
- "1.20.6"
steps:
- name: Checkout the pull request code
uses: actions/checkout@v3
- name: Setup Golang version ${{ matrix.go_version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go_version }}
- name: Install build dependencies
if: matrix.type == 'dev'
run: |
sudo apt-get update -y
sudo apt-get install -y libvirt-dev
- name: Build
run: |
# Build the binaries
if [ ${{ matrix.type }} == "release" ]; then
RELEASE_BUILD=true make build
else
RELEASE_BUILD=false make build
fi
- name: Test
if: matrix.type == 'dev'
run: |
go install github.com/jstemmer/[email protected]
export CI="true"
sudo -E env PATH="$PATH" make test | tee tests_report.txt
sudo chmod o+rw tests_report.txt
cat tests_report.txt | $(go env GOPATH)/bin/go-junit-report -set-exit-code > tests_report_junit.xml
shell: bash
- name: Upload tests report
uses: actions/upload-artifact@v3
if: matrix.type == 'dev'
with:
name: tests_report_junit-${{ matrix.runner }}_${{ matrix.go_version }}
path: ${{ github.workspace }}/tests_report_junit.xml
retention-days: 1