Repository navigation
80 lines (68 loc) · 2.36 KB
/
Copy pathtest.yml
File metadata and controls
80 lines (68 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Tests
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
workflow_dispatch:
permissions:
contents: read
jobs:
build-images:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro: [focal, noble]
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
- name: Build image
run: |
docker build --file script/Dockerfile.${{ matrix.distro }} --tag glb-director-build-${{ matrix.distro }}:latest .
docker save glb-director-build-${{ matrix.distro }}:latest --output glb-director-build-${{ matrix.distro }}.tar
- name: Upload image artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: build-${{ matrix.distro }}
path: glb-director-build-${{ matrix.distro }}.tar
retention-days: 1
test:
needs: build-images
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-suite: [director, director-xdp, healthcheck, redirect]
distro: [focal, noble]
exclude:
# The DPDK-based glb-director only builds on focal (DPDK 17 / KNI).
# On other distros the supported forwarder is glb-director-xdp, so
# skip the director suite there. This mirrors the same exclusion in
# script/test-local.
- distro: noble
test-suite: director
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Download image artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: build-${{ matrix.distro }}
- name: Load Docker image
run: |
docker load --input glb-director-build-${{ matrix.distro }}.tar
- name: Run test suite in container
run: |
docker run --rm \
--privileged \
--volume $(pwd):/workspace \
--workdir /workspace \
glb-director-build-${{ matrix.distro }}:latest \
bash -c "cd /workspace/src/glb-${{ matrix.test-suite }} && script/test"