build: Only run Intel + glibc on PR builds for x86-64 tests

Run all the tests on the merge queue.

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford 2024-02-28 12:08:45 +00:00
parent f15ca1aec3
commit 81b95023c4

View File

@ -7,16 +7,18 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
runner: ["garm-jammy", "garm-jammy-amd"] runner: ['garm-jammy', "garm-jammy-amd"]
libc: ["musl", "gnu"] libc: ["musl", 'gnu']
name: Tests (x86-64) name: Tests (x86-64)
runs-on: ${{ matrix.runner }} runs-on: ${{ github.event_name == 'pull_request' && !(matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') && 'ubuntu-latest' || matrix.runner }}
steps: steps:
- name: Code checkout - name: Code checkout
if: ${{ github.event_name != 'pull_request' || (matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') }}
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install Docker - name: Install Docker
if: ${{ github.event_name != 'pull_request' || (matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') }}
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get -y install ca-certificates curl gnupg sudo apt-get -y install ca-certificates curl gnupg
@ -26,14 +28,22 @@ jobs:
sudo apt-get update sudo apt-get update
sudo apt install -y docker-ce docker-ce-cli sudo apt install -y docker-ce docker-ce-cli
- name: Prepare for VDPA - name: Prepare for VDPA
if: ${{ github.event_name != 'pull_request' || (matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') }}
run: scripts/prepare_vdpa.sh run: scripts/prepare_vdpa.sh
- name: Run unit tests - name: Run unit tests
if: ${{ github.event_name != 'pull_request' || (matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') }}
run: scripts/dev_cli.sh tests --unit --libc ${{ matrix.libc }} run: scripts/dev_cli.sh tests --unit --libc ${{ matrix.libc }}
- name: Load openvswitch module - name: Load openvswitch module
if: ${{ github.event_name != 'pull_request' || (matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') }}
run: sudo modprobe openvswitch run: sudo modprobe openvswitch
- name: Run integration tests - name: Run integration tests
if: ${{ github.event_name != 'pull_request' || (matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') }}
timeout-minutes: 40 timeout-minutes: 40
run: scripts/dev_cli.sh tests --integration --libc ${{ matrix.libc }} run: scripts/dev_cli.sh tests --integration --libc ${{ matrix.libc }}
- name: Run live-migration integration tests - name: Run live-migration integration tests
if: ${{ github.event_name != 'pull_request' || (matrix.runner == 'garm-jammy' && matrix.libc == 'gnu') }}
timeout-minutes: 20 timeout-minutes: 20
run: scripts/dev_cli.sh tests --integration-live-migration --libc ${{ matrix.libc }} run: scripts/dev_cli.sh tests --integration-live-migration --libc ${{ matrix.libc }}
- name: Skipping build for PR
if: ${{ github.event_name == 'pull_request' && matrix.runner != 'garm-jammy' && matrix.libc != 'gnu' }}
run: echo "Skipping build for PR"