Skip to content

Commit 7785e1b

Browse files
authored
ci: separate Go and Rust tests (#567)
Signed-off-by: Florian Lehner <[email protected]>
1 parent 6197768 commit 7785e1b

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

.github/workflows/env/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: Common environment setup
22

3+
inputs:
4+
skip_rust:
5+
description: 'Set to true to skip installing Rust toolchains'
6+
required: false
7+
type: boolean
8+
default: false
9+
310
runs:
411
using: composite
512
steps:
@@ -37,6 +44,7 @@ runs:
3744
cache-dependency-path: go.sum
3845
id: go
3946
- name: Install Rust
47+
if: ${{ inputs.skip_rust == false }}
4048
uses: dtolnay/rust-toolchain@stable
4149
with:
4250
targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-musl

.github/workflows/unit-test-on-pull-request.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ jobs:
6060
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6161
- name: Set up environment
6262
uses: ./.github/workflows/env
63+
with:
64+
skip_rust: true
6365
- name: Cache coredump modules
6466
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6567
with:
@@ -68,11 +70,23 @@ jobs:
6870
restore-keys: |
6971
coredumps-${{ matrix.target_arch }}
7072
coredumps-
71-
- name: Direct Rust test
72-
run: make rust-tests
7373
- name: Tests
7474
run: make test TARGET_ARCH=${{ matrix.target_arch }}
7575

76+
rust-test:
77+
name: Rust Tests (${{ matrix.target_arch }})
78+
runs-on: ubuntu-24.04
79+
strategy:
80+
matrix:
81+
target_arch: [amd64, arm64]
82+
steps:
83+
- name: Clone code
84+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
85+
- name: Set up environment
86+
uses: ./.github/workflows/env
87+
- name: Tests
88+
run: make rust-tests
89+
7690
check-binary-blobs:
7791
name: Check for differences in the eBPF binary blobs
7892
runs-on: ubuntu-24.04

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ vanity-import-fix: $(PORTO)
102102
@go install github.com/jcchavezs/porto/cmd/porto@latest
103103
@porto --include-internal -w .
104104

105-
test: generate ebpf test-deps rust-components
105+
test: generate ebpf test-deps
106106
go test $(GO_FLAGS) -tags $(GO_TAGS) ./...
107107

108108
# This target isn't called from CI, it doesn't work for cross compile (ie TARGET_ARCH=arm64 on

0 commit comments

Comments
 (0)