Skip to content

Commit af28dec

Browse files
committed
Add CI tests with a sysroot compiled in release mode
1 parent 8ead881 commit af28dec

File tree

2 files changed

+113
-1
lines changed

2 files changed

+113
-1
lines changed

.github/workflows/release.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: CI with sysroot compiled in release mode
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
permissions:
8+
contents: read
9+
10+
env:
11+
# Enable backtraces for easier debugging
12+
RUST_BACKTRACE: 1
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
libgccjit_version:
22+
- { gcc: "libgccjit.so", artifacts_branch: "master" }
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- uses: actions/checkout@v2
28+
with:
29+
repository: llvm/llvm-project
30+
path: llvm
31+
32+
- name: Install packages
33+
run: sudo apt-get install ninja-build ripgrep
34+
35+
- name: Download artifact
36+
uses: dawidd6/action-download-artifact@v2
37+
with:
38+
workflow: main.yml
39+
name: ${{ matrix.libgccjit_version.gcc }}
40+
path: gcc-build
41+
repo: antoyo/gcc
42+
branch: ${{ matrix.libgccjit_version.artifacts_branch }}
43+
event: push
44+
search_artifacts: true # Because, instead, the action only check the last job ran and that won't work since we want multiple artifacts.
45+
46+
- name: Setup path to libgccjit
47+
run: |
48+
echo $(readlink -f gcc-build) > gcc_path
49+
# NOTE: the filename is still libgccjit.so even when the artifact name is different.
50+
ln gcc-build/libgccjit.so gcc-build/libgccjit.so.0
51+
52+
- name: Set env
53+
run: |
54+
echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
55+
echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
56+
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
57+
58+
- name: Set RUST_COMPILER_RT_ROOT
59+
run: echo "RUST_COMPILER_RT_ROOT="${{ env.workspace }}/llvm/compiler-rt >> $GITHUB_ENV
60+
61+
# https://github.com/actions/cache/issues/133
62+
- name: Fixup owner of ~/.cargo/
63+
# Don't remove the trailing /. It is necessary to follow the symlink.
64+
run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/
65+
66+
- name: Cache cargo installed crates
67+
uses: actions/cache@v1.1.2
68+
with:
69+
path: ~/.cargo/bin
70+
key: cargo-installed-crates2-ubuntu-latest
71+
72+
- name: Cache cargo registry
73+
uses: actions/cache@v1
74+
with:
75+
path: ~/.cargo/registry
76+
key: ${{ runner.os }}-cargo-registry2-${{ hashFiles('**/Cargo.lock') }}
77+
78+
- name: Cache cargo index
79+
uses: actions/cache@v1
80+
with:
81+
path: ~/.cargo/git
82+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
83+
84+
- name: Cache cargo target dir
85+
uses: actions/cache@v1.1.2
86+
with:
87+
path: target
88+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
89+
90+
- name: Build
91+
run: |
92+
./prepare_build.sh
93+
./build.sh --release --release-sysroot
94+
cargo test
95+
./clean_all.sh
96+
97+
- name: Prepare dependencies
98+
run: |
99+
git config --global user.email "user@example.com"
100+
git config --global user.name "User"
101+
./prepare.sh
102+
103+
# Compile is a separate step, as the actions-rs/cargo action supports error annotations
104+
- name: Compile
105+
uses: actions-rs/cargo@v1.0.3
106+
with:
107+
command: build
108+
args: --release
109+
110+
- name: Run tests
111+
run: |
112+
./test.sh --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests --test-libcore

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ while [[ $# -gt 0 ]]; do
4444
shift
4545
;;
4646
"--test-rustc")
47-
funcs=(test_rustc)
47+
funcs+=(test_rustc)
4848
shift
4949
;;
5050
"--test-successful-rustc")

0 commit comments

Comments
 (0)