constellation/.github/workflows/test-unittest.yml
Otto Bittner 5d293e355d Build-as-a-Test & Abortable Workflows (#231)
* build cli on every PR
* build coordinator on every PR,
  while only triggering image builds on main.
* abort previous runs of workflows if new commits are pushed
Co-authored-by: Fabian Kammel <fk@edgelss.systems>
2022-06-30 11:27:23 +02:00

37 lines
834 B
YAML

name: Unit Tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
# Abort runs of *this* workflow, if a new commit with the same ref is pushed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
env:
GOPRIVATE: github.com/edgelesssys/*
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y pkg-config libcryptsetup12 libcryptsetup-dev libvirt-dev
- name: Test main module
run: go test -race -count=3 ./...
- name: Test hack module
run: go test -race -count=3 ./...
working-directory: hack