From 5e6a3be56c60935e31dc71a93e7166ea4d427a82 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 24 Jun 2022 21:47:37 +0200 Subject: [PATCH 1/4] Merge duplicated rules --- test.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test.sh b/test.sh index 8b390f95a4b9..9e69d14c0626 100755 --- a/test.sh +++ b/test.sh @@ -24,6 +24,7 @@ while [[ $# -gt 0 ]]; do case $1 in --release) codegen_channel=release + channel="release" shift ;; --release-sysroot) @@ -40,10 +41,6 @@ while [[ $# -gt 0 ]]; do flags="$flags --features $1" shift ;; - --release) - channel="release" - shift - ;; "--test-rustc") func=test_rustc shift From ed37ed7cb8dcb2855cd95166d45b753ffab112dc Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 24 Jun 2022 21:47:55 +0200 Subject: [PATCH 2/4] Simplify github actions conf --- .github/workflows/ci.yml | 52 +++++++++++++++++++++++++--------------- test.sh | 29 +++++++++++++++------- 2 files changed, 53 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d62ac47dedb6..3dbf8d922152 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,10 @@ jobs: strategy: fail-fast: false matrix: - libgccjit_version: ["libgccjit.so", "libgccjit_without_int128.so", "libgccjit12.so"] + libgccjit_version: + - { gcc: "libgccjit.so", extra: "" } + - { gcc: "libgccjit_without_int128.so", extra: "" } + - { gcc: "libgccjit12.so", extra: "--no-default-features" } steps: - uses: actions/checkout@v2 @@ -28,7 +31,7 @@ jobs: uses: dawidd6/action-download-artifact@v2 with: workflow: main.yml - name: ${{ matrix.libgccjit_version }} + name: ${{ matrix.libgccjit_version.gcc }} path: gcc-build repo: antoyo/gcc search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts. @@ -78,19 +81,10 @@ jobs: key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }} - name: Build - if: matrix.libgccjit_version != 'libgccjit12.so' run: | ./prepare_build.sh - ./build.sh - cargo test - ./clean_all.sh - - - name: Build - if: matrix.libgccjit_version == 'libgccjit12.so' - run: | - ./prepare_build.sh - ./build.sh --no-default-features - cargo test --no-default-features + ./build.sh ${{ matrix.libgccjit_version.extra }} + cargo test ${{ matrix.libgccjit_version.extra }} ./clean_all.sh - name: Prepare dependencies @@ -106,8 +100,7 @@ jobs: command: build args: --release - - name: Test - if: matrix.libgccjit_version != 'libgccjit12.so' + - name: Test std_tests run: | # Enable backtraces for easier debugging export RUST_BACKTRACE=1 @@ -116,10 +109,9 @@ jobs: export COMPILE_RUNS=2 export RUN_RUNS=2 - ./test.sh --release + ./test.sh --release --clean --build-sysroot --std-tests ${{ matrix.libgccjit_version.extra }} - - name: Test - if: matrix.libgccjit_version == 'libgccjit12.so' + - name: Test test_libcore run: | # Enable backtraces for easier debugging export RUST_BACKTRACE=1 @@ -128,7 +120,29 @@ jobs: export COMPILE_RUNS=2 export RUN_RUNS=2 - ./test.sh --release --no-default-features + ./test.sh --release --test-libcore ${{ matrix.libgccjit_version.extra }} + + - name: Test extended_sysroot_tests + run: | + # Enable backtraces for easier debugging + export RUST_BACKTRACE=1 + + # Reduce amount of benchmark runs as they are slow + export COMPILE_RUNS=2 + export RUN_RUNS=2 + + ./test.sh --release --extended-tests ${{ matrix.libgccjit_version.extra }} + + - name: Test test_rustc + run: | + # Enable backtraces for easier debugging + export RUST_BACKTRACE=1 + + # Reduce amount of benchmark runs as they are slow + export COMPILE_RUNS=2 + export RUN_RUNS=2 + + ./test.sh --release --test-rustc ${{ matrix.libgccjit_version.extra }} duplicates: runs-on: ubuntu-latest diff --git a/test.sh b/test.sh index 9e69d14c0626..b4d10fa6e4d2 100755 --- a/test.sh +++ b/test.sh @@ -17,7 +17,7 @@ export LIBRARY_PATH="$GCC_PATH" flags= gcc_master_branch=1 channel="debug" -func=all +funcs=() build_only=0 while [[ $# -gt 0 ]]; do @@ -42,32 +42,36 @@ while [[ $# -gt 0 ]]; do shift ;; "--test-rustc") - func=test_rustc + funcs+=(test_rustc) shift ;; "--test-libcore") - func=test_libcore + funcs+=(test_libcore) shift ;; "--clean-ui-tests") - func=clean_ui_tests + funcs+=(clean_ui_tests) + shift + ;; + "--clean") + funcs+=(clean) shift ;; "--std-tests") - func=std_tests + funcs+=(std_tests) shift ;; "--extended-tests") - func=extended_sysroot_tests + funcs+=(extended_sysroot_tests) shift ;; "--build-sysroot") - func=build_sysroot + funcs+=(build_sysroot) shift ;; "--build") @@ -84,7 +88,6 @@ done if [[ $channel == "release" ]]; then export CHANNEL='release' CARGO_INCREMENTAL=1 cargo rustc --release $flags - shift else echo $LD_LIBRARY_PATH export CHANNEL='debug' @@ -92,6 +95,7 @@ else fi if (( $build_only == 1 )); then + echo "Since it's `build-only`, exiting..." exit fi @@ -285,4 +289,11 @@ function all() { test_rustc } -$func +if [ ${#funcs[@]} -eq 0 ]; then + echo "No command passed, running `--all`..." + all +else + for t in ${funcs[@]}; do + $t + done +fi From 9a42e6b47412d09faaab685ab0a0706fbe13ba2e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 29 Jun 2022 15:38:13 +0200 Subject: [PATCH 3/4] Clean up environment variables --- .github/workflows/ci.yml | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dbf8d922152..97ce8e31f879 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,10 @@ on: - push - pull_request +env: + # Enable backtraces for easier debugging + RUST_BACKTRACE: 1 + jobs: build: runs-on: ubuntu-latest @@ -102,46 +106,18 @@ jobs: - name: Test std_tests run: | - # Enable backtraces for easier debugging - export RUST_BACKTRACE=1 - - # Reduce amount of benchmark runs as they are slow - export COMPILE_RUNS=2 - export RUN_RUNS=2 - ./test.sh --release --clean --build-sysroot --std-tests ${{ matrix.libgccjit_version.extra }} - name: Test test_libcore run: | - # Enable backtraces for easier debugging - export RUST_BACKTRACE=1 - - # Reduce amount of benchmark runs as they are slow - export COMPILE_RUNS=2 - export RUN_RUNS=2 - ./test.sh --release --test-libcore ${{ matrix.libgccjit_version.extra }} - name: Test extended_sysroot_tests run: | - # Enable backtraces for easier debugging - export RUST_BACKTRACE=1 - - # Reduce amount of benchmark runs as they are slow - export COMPILE_RUNS=2 - export RUN_RUNS=2 - ./test.sh --release --extended-tests ${{ matrix.libgccjit_version.extra }} - name: Test test_rustc run: | - # Enable backtraces for easier debugging - export RUST_BACKTRACE=1 - - # Reduce amount of benchmark runs as they are slow - export COMPILE_RUNS=2 - export RUN_RUNS=2 - ./test.sh --release --test-rustc ${{ matrix.libgccjit_version.extra }} duplicates: From 4ef0d19becccb2ae84e1971bb440b0fb74e0f8b5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 29 Jun 2022 15:40:11 +0200 Subject: [PATCH 4/4] Add --mini-tests option and run mini-tests in CI --- .github/workflows/ci.yml | 6 +++++- test.sh | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 97ce8e31f879..4e2647dd4273 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,9 +104,13 @@ jobs: command: build args: --release + - name: Test mini_tests + run: | + ./test.sh --release --clean --build-sysroot --mini-tests ${{ matrix.libgccjit_version.extra }} + - name: Test std_tests run: | - ./test.sh --release --clean --build-sysroot --std-tests ${{ matrix.libgccjit_version.extra }} + ./test.sh --release --std-tests ${{ matrix.libgccjit_version.extra }} - name: Test test_libcore run: | diff --git a/test.sh b/test.sh index b4d10fa6e4d2..904434807c46 100755 --- a/test.sh +++ b/test.sh @@ -69,6 +69,10 @@ while [[ $# -gt 0 ]]; do funcs+=(extended_sysroot_tests) shift ;; + "--mini-tests") + funcs+=(mini_tests) + shift + ;; "--build-sysroot") funcs+=(build_sysroot)