docker: Add rust-sdk memcheck target.

docker: Separate and tweak cargo cache paths.

ci: Improve memcheck job targets.

cargo: Add missing debug syms to bench profile.

docker: Optimize layer copying.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-10-27 17:49:29 +00:00
parent 51681aec1b
commit a3f6971579
14 changed files with 163 additions and 137 deletions

View File

@@ -20,13 +20,13 @@ jobs:
name: Init
runs-on: ${{matrix.runner}}
env:
default_cargo_profiles: '["test", "release"]'
default_cargo_profiles: '["test", "bench", "release"]'
default_feat_sets: '["none", "default", "all"]'
default_rust_toolchains: '["nightly", "stable"]'
default_sys_names: '["debian"]'
default_sys_versions: '["testing-slim"]'
default_rust_targets: '["x86_64-unknown-linux-gnu"]'
default_sys_targets: '["x86_64-v1-linux-gnu"]'
default_sys_targets: '["x86_64-v1-linux-gnu", "x86_64-v3-linux-gnu"]'
default_machines: '["X64"]'
outputs:
@@ -38,17 +38,17 @@ jobs:
sys_targets: ${{vars.SYS_TARGETS || env.default_sys_targets}}
sys_versions: ${{vars.SYS_VERSIONS || env.default_sys_versions}}
machines: ${{vars.MACHINES || env.default_machines}}
package: ${{vars.PACKAGE || !contains(github.ref, 'refs/pull/')}}
publish: ${{vars.PUBLISH || !contains(github.ref, 'refs/pull/')}}
build_nix: ${{vars.BUILD_NIX || !contains(github.ref, 'refs/pull/')}}
build_pkgs: ${{vars.BUILD_PKGS || github.ref == 'refs/heads/main' || contains(github.ref, 'tags/v')}}
package: ${{vars.PACKAGE != 'false'}}
publish: ${{vars.PUBLISH != 'false'}}
build_nix: ${{vars.BUILD_NIX != 'false'}}
build_pkgs: ${{vars.BUILD_PKGS || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/test' || contains(github.ref, 'tags/v')}}
check_pkgs: ${{vars.CHECK_PKGS || 'false'}}
complement: ${{vars.COMPLEMENT || 'true'}}
complement: ${{vars.COMPLEMENT != 'false'}}
complement_runner: 'het'
docker_repo: ${{vars.DOCKER_REPO}}
release_url: ${{steps.release.outputs.upload_url}}
pages_url: 'https://matrix-construct.github.io/tuwunel/'
rust_sdk_integration: ${{vars.RUST_SDK_INTEGRATION || 'true'}}
rust_sdk_integ: ${{vars.RUST_SDK_INTEGRATION != 'false'}}
head_msg: ${{github.event.head_commit.message || github.event.workflow_run.head_commit.message}}
strategy:
@@ -176,7 +176,7 @@ jobs:
with:
head_msg: ${{needs.init.outputs.head_msg}}
build_nix: ${{fromJSON(needs.init.outputs.build_nix)}}
rust_sdk_integration: ${{fromJSON(needs.init.outputs.rust_sdk_integration)}}
rust_sdk_integ: ${{fromJSON(needs.init.outputs.rust_sdk_integ)}}
complement: ${{fromJSON(needs.init.outputs.complement)}}
complement_runner: ${{needs.init.outputs.complement_runner}}
cargo_profiles: ${{needs.init.outputs.cargo_profiles}}
@@ -222,6 +222,7 @@ jobs:
if: >
!failure() && !cancelled()
&& needs.init.outputs.package
&& !contains(github.ref, 'refs/pull')
&& !contains(needs.init.outputs.head_msg, '[ci only it]')
&& !contains(needs.init.outputs.head_msg, '[ci no build]')
&& !contains(needs.init.outputs.head_msg, '[ci no package]')
@@ -285,6 +286,7 @@ jobs:
if: >
!failure() && !cancelled()
&& needs.init.outputs.publish
&& !contains(github.ref, 'refs/pull')
&& !contains(needs.init.outputs.head_msg, '[ci only it]')
&& !contains(needs.init.outputs.head_msg, '[ci no build]')
&& !contains(needs.init.outputs.head_msg, '[ci no package]')

View File

@@ -40,7 +40,7 @@ on:
default: true
complement_runner:
type: string
rust_sdk_integration:
rust_sdk_integ:
type: boolean
default: true
build_nix:
@@ -81,10 +81,10 @@ jobs:
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
name: Unit
name: Module
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["unit", "integration"]'
bake_targets: '["unit", "integ"]'
cargo_profiles: '["test"]'
feat_sets: '["all"]'
rust_toolchains: ${{inputs.rust_toolchains}}
@@ -107,7 +107,7 @@ jobs:
name: Bench
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["unit", "integration"]'
bake_targets: '["unit", "integ"]'
cargo_profiles: '["bench"]'
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
@@ -119,7 +119,7 @@ jobs:
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
valgrind:
memcheck:
if: >
!contains(inputs.head_msg, '[ci only it]')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["bench"]')[0])
@@ -130,8 +130,9 @@ jobs:
name: Memcheck
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["integration-valgrind"]'
cargo_profiles: '["bench"]'
#bake_targets: '["unit-valgrind", "integ-valgrind"]'
bake_targets: '["integ-valgrind"]'
cargo_profiles: '["bench"]' # use bench not release for debug syms
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
@@ -139,8 +140,8 @@ jobs:
rust_targets: ${{inputs.rust_targets}}
sys_targets: '["x86_64-v3-linux-gnu"]'
machines: ${{inputs.machines}}
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
excludes: ${{inputs.excludes}}
smoke:
if: >
@@ -222,6 +223,7 @@ jobs:
!failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci only it]')
&& !contains(inputs.head_msg, '[ci no build]')
&& !contains(github.ref, 'refs/pull')
&& contains(fromJSON(inputs.cargo_profiles), fromJSON('["release"]')[0])
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["stable"]')[0])
@@ -243,45 +245,56 @@ jobs:
excludes: ${{inputs.excludes}}
includes: ${{inputs.includes}}
matrix-rust-sdk-integration:
rust-sdk-integ:
if: >
!failure() && !cancelled()
&& !contains(inputs.head_msg, '[ci no build]')
&& inputs.rust_sdk_integration
&& inputs.rust_sdk_integ
&& contains(fromJSON(inputs.feat_sets), fromJSON('["all"]')[0])
&& contains(fromJSON(inputs.rust_toolchains), fromJSON('["nightly"]')[0])
&& contains(fromJSON(inputs.rust_targets), fromJSON('["x86_64-unknown-linux-gnu"]')[0])
&& contains(fromJSON(inputs.sys_targets), fromJSON('["x86_64-v1-linux-gnu"]')[0])
name: Matrix SDK Integration
needs: [smoke]
uses: ./.github/workflows/bake.yml
with:
bake_targets: '["matrix-rust-sdk-integration"]'
#bake_targets: '["rust-sdk-integ", "rust-sdk-valgrind"]'
bake_targets: '["rust-sdk-integ"]'
cargo_profiles: ${{inputs.cargo_profiles}}
feat_sets: '["all"]'
rust_toolchains: '["nightly"]'
sys_names: ${{inputs.sys_names}}
sys_versions: ${{inputs.sys_versions}}
rust_targets: '["x86_64-unknown-linux-gnu"]'
sys_targets: '["x86_64-v1-linux-gnu"]'
sys_targets: ${{inputs.sys_targets}}
machines: '["X64"]'
runner: ${{inputs.complement_runner}}
includes: ${{inputs.includes}}
artifact: >
{
"matrix-rust-sdk-integration": {
"rust-sdk-integ": {
"src": "/var/log/tuwunel.log",
"dst": "matrix-rust-sdk-integration.tuwunel.log",
"dst": "rust-sdk-integ.tuwunel.log",
},
"rust-sdk-valgrind": {
"src": "/var/log/tuwunel.log",
"dst": "rust-sdk-valgrind.tuwunel.log",
}
}
excludes: >
[
{"bake_target": "rust-sdk-valgrind", "cargo_profile": "test"},
{"feat_set": "none"},
{"feat_set": "logging"},
{"cargo_profile": "release"},
{"cargo_profile": "release-debuginfo"},
{"cargo_profile": "release-native"},
{"cargo_profile": "test", "sys_target": "x86_64-v2-linux-gnu"},
{"cargo_profile": "test", "sys_target": "x86_64-v3-linux-gnu"},
{"cargo_profile": "bench", "sys_target": "x86_64-v1-linux-gnu"},
{"cargo_profile": "bench", "sys_target": "x86_64-v2-linux-gnu"},
{"rust_target": "aarch64-unknown-linux-gnu"},
{"sys_target": "aarch64-v8-linux-gnu"},
]
complement: