Simplify github actions conf

This commit is contained in:
Guillaume Gomez 2022-06-24 21:47:55 +02:00
parent 5e6a3be56c
commit ed37ed7cb8
2 changed files with 53 additions and 28 deletions

View File

@ -11,7 +11,10 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: 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: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -28,7 +31,7 @@ jobs:
uses: dawidd6/action-download-artifact@v2 uses: dawidd6/action-download-artifact@v2
with: with:
workflow: main.yml workflow: main.yml
name: ${{ matrix.libgccjit_version }} name: ${{ matrix.libgccjit_version.gcc }}
path: gcc-build path: gcc-build
repo: antoyo/gcc 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. 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') }} key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
- name: Build - name: Build
if: matrix.libgccjit_version != 'libgccjit12.so'
run: | run: |
./prepare_build.sh ./prepare_build.sh
./build.sh ./build.sh ${{ matrix.libgccjit_version.extra }}
cargo test cargo test ${{ matrix.libgccjit_version.extra }}
./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
./clean_all.sh ./clean_all.sh
- name: Prepare dependencies - name: Prepare dependencies
@ -106,8 +100,7 @@ jobs:
command: build command: build
args: --release args: --release
- name: Test - name: Test std_tests
if: matrix.libgccjit_version != 'libgccjit12.so'
run: | run: |
# Enable backtraces for easier debugging # Enable backtraces for easier debugging
export RUST_BACKTRACE=1 export RUST_BACKTRACE=1
@ -116,10 +109,9 @@ jobs:
export COMPILE_RUNS=2 export COMPILE_RUNS=2
export RUN_RUNS=2 export RUN_RUNS=2
./test.sh --release ./test.sh --release --clean --build-sysroot --std-tests ${{ matrix.libgccjit_version.extra }}
- name: Test - name: Test test_libcore
if: matrix.libgccjit_version == 'libgccjit12.so'
run: | run: |
# Enable backtraces for easier debugging # Enable backtraces for easier debugging
export RUST_BACKTRACE=1 export RUST_BACKTRACE=1
@ -128,7 +120,29 @@ jobs:
export COMPILE_RUNS=2 export COMPILE_RUNS=2
export RUN_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: duplicates:
runs-on: ubuntu-latest runs-on: ubuntu-latest

29
test.sh
View File

@ -17,7 +17,7 @@ export LIBRARY_PATH="$GCC_PATH"
flags= flags=
gcc_master_branch=1 gcc_master_branch=1
channel="debug" channel="debug"
func=all funcs=()
build_only=0 build_only=0
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
@ -42,32 +42,36 @@ while [[ $# -gt 0 ]]; do
shift shift
;; ;;
"--test-rustc") "--test-rustc")
func=test_rustc funcs+=(test_rustc)
shift shift
;; ;;
"--test-libcore") "--test-libcore")
func=test_libcore funcs+=(test_libcore)
shift shift
;; ;;
"--clean-ui-tests") "--clean-ui-tests")
func=clean_ui_tests funcs+=(clean_ui_tests)
shift
;;
"--clean")
funcs+=(clean)
shift shift
;; ;;
"--std-tests") "--std-tests")
func=std_tests funcs+=(std_tests)
shift shift
;; ;;
"--extended-tests") "--extended-tests")
func=extended_sysroot_tests funcs+=(extended_sysroot_tests)
shift shift
;; ;;
"--build-sysroot") "--build-sysroot")
func=build_sysroot funcs+=(build_sysroot)
shift shift
;; ;;
"--build") "--build")
@ -84,7 +88,6 @@ done
if [[ $channel == "release" ]]; then if [[ $channel == "release" ]]; then
export CHANNEL='release' export CHANNEL='release'
CARGO_INCREMENTAL=1 cargo rustc --release $flags CARGO_INCREMENTAL=1 cargo rustc --release $flags
shift
else else
echo $LD_LIBRARY_PATH echo $LD_LIBRARY_PATH
export CHANNEL='debug' export CHANNEL='debug'
@ -92,6 +95,7 @@ else
fi fi
if (( $build_only == 1 )); then if (( $build_only == 1 )); then
echo "Since it's `build-only`, exiting..."
exit exit
fi fi
@ -285,4 +289,11 @@ function all() {
test_rustc test_rustc
} }
$func if [ ${#funcs[@]} -eq 0 ]; then
echo "No command passed, running `--all`..."
all
else
for t in ${funcs[@]}; do
$t
done
fi