Skip to content

Validations

Validations #500

Workflow file for this run

name: "Validations"
on:
workflow_dispatch:
inputs:
run-tmate:
description: "Start a tmate session"
required: false
default: ""
tmate-duration:
description: "Tmate session duration"
required: false
default: 5
push:
branches:
- main
pull_request:
jobs:
Static-Analysis:
name: "Static analysis"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Bootstrap environment
uses: ./.github/actions/bootstrap
- name: Run static analysis
run: make static-analysis
Unit-Test:
name: "Unit tests"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Bootstrap environment
uses: ./.github/actions/bootstrap
- name: Run unit tests
run: make unit
- uses: actions/upload-artifact@v2
with:
name: unit-test-results
path: test/results/**/*
Integration-Test:
name: "Integration tests"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Bootstrap environment
uses: ./.github/actions/bootstrap
- name: Enable systemd for podman socket activation
run: |
set -x
loginctl enable-linger $(whoami)
# we need to make certain that the bus instance is up and ready before systemctl attempts to use it.
# if we can figure a non-racey way to do this, that would be nice.
sleep 5
export XDG_RUNTIME_DIR=/run/user/$UID
mkdir -p $HOME/.config/systemd/user
systemctl --user enable --now podman.socket
sudo systemctl enable --now podman.socket
sudo systemctl start podman.socket
sleep 1
# simple test to make sure the daemon is up and running
podman images ls
sudo podman images ls
- name: Setup containerd
uses: crazy-max/ghaction-setup-containerd@v2
- name: Setup tmate session
if: ${{ github.event.inputs.run-tmate == 'true' }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: ${{ fromJSON(github.event.inputs.tmate-duration) }}
with:
limit-access-to-actor: true
- name: Build key for test-fixture cache
run: make integration-fingerprint
- name: Restore integration test-fixture cache
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/test/integration/test-fixtures/cache
key: ${{ runner.os }}-integration-test-cache-${{ hashFiles('test/integration/test-fixtures/cache.fingerprint') }}
- name: Build key for tool cache
run: make integration-tools-fingerprint
- name: Restore integration tool cache
id: integration-tool-cache
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/test/integration/tools/cache
key: ${{ runner.os }}-integration-tools-cache-${{ hashFiles('test/integration/tools/cache.fingerprint') }}
- name: (cache-hit) Load integration tool cache
if: steps.integration-tool-cache.outputs.cache-hit == 'true'
run: make integration-tools-load
- name: Run integration tests
# why sudo? containerd in the pipeline is only accessible to root (/var/run/containerd/containerd.sock)
# -E to preserve the environment (thus use the same go root, etc)
run: sudo -E make integration
Build-Snapshot-Artifacts:
name: "Build snapshot artifacts"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Bootstrap environment
uses: ./.github/actions/bootstrap
- name: Build snapshot artifacts
run: make snapshot