-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (68 loc) · 2.67 KB
/
sterile-build-and-test.yml
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
# This is a sterile build and test workflow that uses the `dev-env` container image
# to build and test the project in a sterile environment.
# Artifacts produced by this workflow are intended to be used for production.
name: Sterile build + test
on:
- push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
just: 1.36.0
permissions:
contents: write
packages: read
id-token: write
jobs:
compile:
runs-on:
- lab
strategy:
fail-fast: false
matrix:
dpdk_sys:
- main
rust:
- toolchain: pinned
- toolchain: stable
steps:
- name: login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: install just
uses: extractions/setup-just@v2
with:
just-version: ${{env.just}}
- name: Checkout
uses: actions/checkout@v4
- run: just rust=${{matrix.rust.toolchain}} sterile cargo build --profile=debug --target=x86_64-unknown-linux-gnu
- run: just rust=${{matrix.rust.toolchain}} sterile cargo test --profile=debug --target=x86_64-unknown-linux-gnu
- run: just rust=${{matrix.rust.toolchain}} sterile cargo build --profile=debug --target=x86_64-unknown-linux-musl
- run: just rust=${{matrix.rust.toolchain}} sterile cargo test --profile=debug --target=x86_64-unknown-linux-musl
- run: just rust=${{matrix.rust.toolchain}} sterile cargo build --profile=release --target=x86_64-unknown-linux-gnu
- run: just rust=${{matrix.rust.toolchain}} sterile cargo test --profile=release --target=x86_64-unknown-linux-gnu
- run: just rust=${{matrix.rust.toolchain}} sterile cargo build --profile=release --target=x86_64-unknown-linux-musl
- run: just rust=${{matrix.rust.toolchain}} sterile cargo test --profile=release --target=x86_64-unknown-linux-musl
- run: |
tar \
--format=posix \
--sort=name \
--clamp-mtime \
--mtime=0 \
--numeric-owner \
--owner=0 \
--group=0 \
--mode='go+u,go-w' \
-cznf dpdk-sys-${{ matrix.dpdk_sys }}-rust-${{ matrix.rust.toolchain }}-sterile.tar.gz \
sterile
- uses: actions/upload-artifact@v4
with:
name: dpdk-sys-${{ matrix.dpdk_sys }}-rust-${{ matrix.rust.toolchain }}-sterile.tar.gz
path: dpdk-sys-${{ matrix.dpdk_sys }}-rust-${{ matrix.rust.toolchain }}-sterile.tar.gz
include-hidden-files: true
retention-days: 1
compression-level: 0
overwrite: true