From 41cda88c79599c4a1ffe953243080792ea64a653 Mon Sep 17 00:00:00 2001 From: shuo Date: Thu, 2 Mar 2023 11:07:21 +0800 Subject: [PATCH 1/2] ci able to override how example runs --- .github/example-run/load_gltf.sh | 2 ++ .github/workflows/ci.yml | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .github/example-run/load_gltf.sh diff --git a/.github/example-run/load_gltf.sh b/.github/example-run/load_gltf.sh new file mode 100644 index 0000000000000..d1f4c448e0fe6 --- /dev/null +++ b/.github/example-run/load_gltf.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec cargo run --example load_gltf --features "bevy_ci_testing,trace,trace_chrome,debug_asset_server" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aac9dce7a5562..791aa886d429c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,7 +197,11 @@ jobs: example_name=`basename $example .ron` echo -n $example_name > last_example_run echo "running $example_name - "`date` - time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome" + if [[ -f ".github/example-run/$example_name.sh" ]]; then + time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run sh .github/example-run/$example_name.sh + else + time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome" + fi sleep 10 done zip traces.zip trace*.json From 57779cb2caef5c0925b5efb720dc4464fdf53d6c Mon Sep 17 00:00:00 2001 From: shuo Date: Thu, 2 Mar 2023 21:36:08 +0800 Subject: [PATCH 2/2] use ENV to pass ci features --- .github/example-run/load_gltf.sh | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/validation-jobs.yml | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/example-run/load_gltf.sh b/.github/example-run/load_gltf.sh index d1f4c448e0fe6..da5914821c486 100644 --- a/.github/example-run/load_gltf.sh +++ b/.github/example-run/load_gltf.sh @@ -1,2 +1,2 @@ #!/bin/sh -exec cargo run --example load_gltf --features "bevy_ci_testing,trace,trace_chrome,debug_asset_server" \ No newline at end of file +exec cargo run --example load_gltf --features $CI_FEATURES --features "debug_asset_server" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 791aa886d429c..270416f934450 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -198,7 +198,7 @@ jobs: echo -n $example_name > last_example_run echo "running $example_name - "`date` if [[ -f ".github/example-run/$example_name.sh" ]]; then - time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run sh .github/example-run/$example_name.sh + time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example CI_FEATURES="bevy_ci_testing,trace,trace_chrome" xvfb-run sh .github/example-run/$example_name.sh else time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome" fi diff --git a/.github/workflows/validation-jobs.yml b/.github/workflows/validation-jobs.yml index 4d306320dae00..6da90825adfc1 100644 --- a/.github/workflows/validation-jobs.yml +++ b/.github/workflows/validation-jobs.yml @@ -88,7 +88,12 @@ jobs: for example in .github/example-run/*.ron; do example_name=`basename $example .ron` echo "running $example_name - "`date` - time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing" + + if [[ -f ".github/example-run/$example_name.sh" ]]; then + time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example CI_FEATURES="bevy_ci_testing" sh .github/example-run/$example_name.sh + then + time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing" + else sleep 10 done