-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test on CI that just the sysroot can be built (#465)
This commit adds a test and matrix entry to CI which asserts that the sysroot can be built to run tests using a stock Clang compiler found on the system. This fixes a few minor issues as well in developing this. This additionally refactors CI a bit to move shared steps amongst jobs into separate composite actions in this repository to avoid duplication across jobs.
- Loading branch information
1 parent
b267916
commit dc74ff1
Showing
5 changed files
with
72 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: 'Prepare wasi-sdk git directory' | ||
description: 'Prepare wasi-sdk git directory' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- run: git fetch --tags --force | ||
name: Force-fetch tags to work around actions/checkout#290 | ||
shell: bash | ||
# We can't use `--depth 1` here sadly because the GNU config | ||
# submodule is not pinned to a particular tag/branch. Please | ||
# bump depth (or even better, the submodule), in case of "error: | ||
# Server does not allow request for unadvertised object" in the | ||
# future. | ||
- run: git submodule update --init --depth 64 --jobs 3 | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'Install wasi-sdk dependencies' | ||
description: 'Install wasi-sdk dependencies' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup `wasmtime` for tests | ||
uses: bytecodealliance/actions/wasmtime/setup@v1 | ||
with: | ||
version: "18.0.2" | ||
- name: Install ccache, ninja (macOS) | ||
run: brew install ccache ninja | ||
if: runner.os == 'macOS' | ||
shell: bash | ||
- name: Install ccache, ninja (Windows) | ||
run: choco install ccache ninja | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
- name: Install ccache, ninja (Linux) | ||
run: sudo apt-get install -y ccache ninja-build | ||
if: runner.os == 'Linux' | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,14 +65,8 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --tags --force | ||
name: Force-fetch tags to work around actions/checkout#290 | ||
# We can't use `--depth 1` here sadly because the GNU config | ||
# submodule is not pinned to a particular tag/branch. Please | ||
# bump depth (or even better, the submodule), in case of "error: | ||
# Server does not allow request for unadvertised object" in the | ||
# future. | ||
- run: git submodule update --init --depth 64 --jobs 3 | ||
- uses: ./.github/actions/checkout | ||
- uses: ./.github/actions/install-deps | ||
|
||
# Persist ccache-based caches across builds. This directory is configured | ||
# via the CCACHE_DIR env var below for ccache to use. | ||
|
@@ -103,21 +97,6 @@ jobs: | |
echo WASI_SDK_CI_TOOLCHAIN_CMAKE_ARGS="$cmake_args" >> $GITHUB_ENV | ||
shell: bash | ||
# Add some extra installed software on each runner as necessary. | ||
- name: Setup `wasmtime` for tests | ||
uses: bytecodealliance/actions/wasmtime/setup@v1 | ||
with: | ||
version: "18.0.2" | ||
- name: Install ccache, ninja (macOS) | ||
run: brew install ccache ninja | ||
if: runner.os == 'macOS' | ||
- name: Install ccache, ninja (Windows) | ||
run: choco install ccache ninja | ||
if: runner.os == 'Windows' | ||
- name: Install ccache, ninja (Linux) | ||
run: sudo apt install ccache | ||
if: runner.os == 'Linux' | ||
|
||
- name: Clear ccache statistics | ||
run: ccache --zero-stats | ||
|
||
|
@@ -184,6 +163,30 @@ jobs: | |
path: ${{ runner.tool_cache }}/ccache | ||
key: 0-cache-${{ matrix.artifact }}-${{ github.run_id }} | ||
|
||
build-only-sysroot: | ||
name: Build only sysroot | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ./.github/actions/checkout | ||
- uses: ./.github/actions/install-deps | ||
- run: | | ||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | ||
name=$(lsb_release -s -c) | ||
sudo add-apt-repository -y "deb http://apt.llvm.org/$name/ llvm-toolchain-$name-18 main" | ||
sudo add-apt-repository -y "deb-src http://apt.llvm.org/$name/ llvm-toolchain-$name-18 main" | ||
sudo apt-get install -y clang-18 llvm-18 lld-18 | ||
- run: cargo install [email protected] | ||
- run: | | ||
cmake -G Ninja -B build -S . \ | ||
-DCMAKE_C_COMPILER=/usr/lib/llvm-18/bin/clang \ | ||
-DCMAKE_SYSTEM_NAME=WASI \ | ||
-DWASI_SDK_INCLUDE_TESTS=ON | ||
- run: ninja -C build | ||
- run: ctest --output-on-failure --parallel 10 --test-dir build/tests | ||
|
||
# Once all of the above matrix entries have completed this job will run and | ||
# assemble the final `wasi-sdk-*` artifacts by fusing the toolchain/sysroot | ||
# artifacts. | ||
|
@@ -195,8 +198,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --tags --force | ||
name: Force-fetch tags to work around actions/checkout#290 | ||
- uses: ./.github/actions/checkout | ||
|
||
# Download all artifacts from all platforms in `build`, merge them into | ||
# final wasi-sdk-* artifacts, and then upload them. | ||
|
@@ -256,16 +258,8 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- run: git fetch --tags --force | ||
name: Force-fetch tags to work around actions/checkout#290 | ||
- run: git submodule update --init --depth 64 --jobs 3 | ||
- name: Setup `wasmtime` for tests | ||
uses: bytecodealliance/actions/wasmtime/setup@v1 | ||
with: | ||
version: "18.0.2" | ||
- name: Install ninja | ||
run: sudo apt-get install -y ninja-build | ||
if: runner.os == 'Linux' | ||
- uses: ./.github/actions/checkout | ||
- uses: ./.github/actions/install-deps | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: dist-x86_64-linux | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters