-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (73 loc) · 2.88 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
76
77
78
79
80
# 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:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run with tmate enabled"
required: false
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
just: 1.36.0
permissions:
contents: write
packages: write
id-token: write
jobs:
compile:
runs-on:
- lab
strategy:
fail-fast: false
matrix:
dpdk_sys:
- main
rust:
- stable
- nightly
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
- uses: actions/setup-node@v4
with:
node-version: "latest"
- run: just rust="${{matrix.rust}}" sterile cargo nextest --profile ci run --locked --target=x86_64-unknown-linux-gnu
- run: npx --yes xunit-viewer -r sterile/target/nextest/ci/junit.xml --output sterile/target/nextest/ci/ci.x86_64-unknown-linux-gnu.html
- run: just rust="${{matrix.rust}}" sterile cargo nextest --profile ci run --locked --target=x86_64-unknown-linux-musl
- run: npx --yes xunit-viewer -r sterile/target/nextest/ci/junit.xml --output sterile/target/nextest/ci/ci.x86_64-unknown-linux-musl.html
- run: just rust="${{matrix.rust}}" sterile cargo test --locked --profile=release --target=x86_64-unknown-linux-gnu
- run: just rust="${{matrix.rust}}" sterile cargo test --locked --profile=release --target=x86_64-unknown-linux-musl
- run: just rust="${{matrix.rust}}" profile=debug target=x86_64-unknown-linux-gnu push-container
- run: just rust="${{matrix.rust}}" profile=release target=x86_64-unknown-linux-gnu push-container
- run: just rust="${{matrix.rust}}" profile=debug target=x86_64-unknown-linux-musl push-container
- run: just rust="${{matrix.rust}}" profile=release target=x86_64-unknown-linux-musl push-container
- uses: actions/upload-artifact@v4
with:
name: 'test-results'
path: sterile/target/nextest/ci/
retention-days: 10
overwrite: 'true'
compression-level: '0'
- name: Setup tmate session for debug
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 30
with:
limit-access-to-actor: true