name: unit-tests
on: [pull_request, workflow_dispatch]
jobs:
  unit-tests:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        startarg: [':latest', ':i386', 'CC=clang']
      fail-fast: false
    timeout-minutes: 60
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
        with:
          # need this to also fetch tags
          fetch-depth: 0

      - name: Build unit test container if it changed
        run: |
          changes=$(git diff --name-only origin/master..HEAD -- containers/unit-tests/)
          [ '${{ matrix.startarg }}' = ':i386' ] && arch=i386 || arch=amd64
          [ -z "$changes" ] || containers/unit-tests/build $arch

      - name: Run unit-tests container
        run: 'containers/unit-tests/start ${{ matrix.startarg }}'

name: unit-tests
on: [pull_request, workflow_dispatch]
jobs:
  unit-tests:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        startarg: [':latest', ':i386', 'CC=clang']
      fail-fast: false
    timeout-minutes: 60
    steps:
      - name: Clone repository
        uses: actions/checkout@v2
        with:
          # need this to also fetch tags
          fetch-depth: 0

      - name: Build unit test container if it changed
        run: |
          changes=$(git diff --name-only origin/master..HEAD -- containers/unit-tests/)
          [ '${{ matrix.startarg }}' = ':i386' ] && arch=i386 || arch=amd64
          [ -z "$changes" ] || containers/unit-tests/build $arch

      - name: Run unit-tests container
        run: 'containers/unit-tests/start ${{ matrix.startarg }}'

Fix unit tests with podman
workflows: Fix unit tests with podman

The recent podman version on the OSBS repo which GitHub workflows use
now fails as unprivileged user on Ubuntu 18.04 (which is still what
`ubuntu-latest` points to):

    ERRO[0063] could not find slirp4netns, the network namespace won't be configured: exec: "slirp4netns": executable file not found in $PATH

This package does not yet exist in 18.04, so move the workflow to 20.04
instead.

Note: We could also run it with sudo or with docker, but let's keep
close to what developers do on their machines.

Closes #15012