mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-14 01:51:03 +00:00
llvm-builder testing workflow (#164)
Co-authored-by: xermicus <cyrill@parity.io>
This commit is contained in:
@@ -0,0 +1,43 @@
|
|||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [assigned, opened, synchronize, reopened]
|
||||||
|
paths:
|
||||||
|
- 'LLVM.lock'
|
||||||
|
- 'crates/llvm-builder/**'
|
||||||
|
- '.github/workflows/revive-llvm-test.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
runner: [parity-large, macos-14, macos-13]
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install apt dependencies
|
||||||
|
if: matrix.runner == 'parity-large'
|
||||||
|
run: |
|
||||||
|
sudo apt update && sudo apt-get install -y cmake ninja-build curl git libssl-dev pkg-config clang lld musl
|
||||||
|
|
||||||
|
- name: Install macos dependencies
|
||||||
|
if: matrix.runner == 'macos-14' || matrix.runner == 'macos-13'
|
||||||
|
run: |
|
||||||
|
brew install ninja
|
||||||
|
|
||||||
|
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
components: rust-src
|
||||||
|
rustflags: ""
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
rustup show
|
||||||
|
cargo --version
|
||||||
|
cmake --version
|
||||||
|
bash --version
|
||||||
|
|
||||||
|
- name: Test llvm-builder
|
||||||
|
run: make test-llvm-builder
|
||||||
|
env:
|
||||||
|
RUST_LOG: trace
|
||||||
@@ -53,6 +53,16 @@ fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
|||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
|
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||||
|
.current_dir(test_dir.path())
|
||||||
|
.arg("build")
|
||||||
|
.arg("--llvm-projects")
|
||||||
|
.arg("clang")
|
||||||
|
.arg("--llvm-projects")
|
||||||
|
.arg("lld")
|
||||||
|
.assert()
|
||||||
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||||
.arg("--target-env")
|
.arg("--target-env")
|
||||||
.arg("musl")
|
.arg("musl")
|
||||||
@@ -65,12 +75,6 @@ fn clone_build_and_clean_musl() -> anyhow::Result<()> {
|
|||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
|
||||||
.current_dir(test_dir.path())
|
|
||||||
.arg("builtins")
|
|
||||||
.assert()
|
|
||||||
.success();
|
|
||||||
|
|
||||||
Command::cargo_bin(common::REVIVE_LLVM)?
|
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||||
.current_dir(test_dir.path())
|
.current_dir(test_dir.path())
|
||||||
.arg("clean")
|
.arg("clean")
|
||||||
@@ -100,6 +104,10 @@ fn debug_build_with_tests_coverage() -> anyhow::Result<()> {
|
|||||||
.arg("--enable-tests")
|
.arg("--enable-tests")
|
||||||
.arg("--build-type")
|
.arg("--build-type")
|
||||||
.arg("Debug")
|
.arg("Debug")
|
||||||
|
.arg("--llvm-projects")
|
||||||
|
.arg("clang")
|
||||||
|
.arg("--llvm-projects")
|
||||||
|
.arg("lld")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
@@ -123,6 +131,10 @@ fn build_with_sanitizers() -> anyhow::Result<()> {
|
|||||||
.arg("build")
|
.arg("build")
|
||||||
.arg("--sanitizer")
|
.arg("--sanitizer")
|
||||||
.arg("Address")
|
.arg("Address")
|
||||||
|
.arg("--llvm-projects")
|
||||||
|
.arg("lld")
|
||||||
|
.arg("--llvm-projects")
|
||||||
|
.arg("clang")
|
||||||
.assert()
|
.assert()
|
||||||
.success();
|
.success();
|
||||||
|
|
||||||
@@ -136,10 +148,31 @@ fn clone_build_and_clean_emscripten() -> anyhow::Result<()> {
|
|||||||
let test_dir = common::TestDir::with_lockfile(None)?;
|
let test_dir = common::TestDir::with_lockfile(None)?;
|
||||||
let command = Command::cargo_bin(common::REVIVE_LLVM)?;
|
let command = Command::cargo_bin(common::REVIVE_LLVM)?;
|
||||||
let program = command.get_program().to_string_lossy();
|
let program = command.get_program().to_string_lossy();
|
||||||
|
|
||||||
|
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||||
|
.current_dir(test_dir.path())
|
||||||
|
.arg("clone")
|
||||||
|
.assert()
|
||||||
|
.success();
|
||||||
|
|
||||||
|
Command::cargo_bin(common::REVIVE_LLVM)?
|
||||||
|
.current_dir(test_dir.path())
|
||||||
|
.arg("build")
|
||||||
|
.arg("--llvm-projects")
|
||||||
|
.arg("lld")
|
||||||
|
.arg("--llvm-projects")
|
||||||
|
.arg("clang")
|
||||||
|
.assert()
|
||||||
|
.success();
|
||||||
|
|
||||||
|
// Two little shell-dependent things here:
|
||||||
|
// Doing `. ./emsdk_env.sh` instead of `source`, as `source` might be missing in some shells
|
||||||
|
// `cd {} && . ./emsdk_env.sh && cd ..` helps the script to locate `emsdk.py`
|
||||||
|
// @see https://github.com/emscripten-core/emsdk/blob/9dbdc4b3437750b85d16931c7c801bb71a782122/emsdk_env.sh#L61-L69
|
||||||
let emsdk_wrapped_build_command = format!(
|
let emsdk_wrapped_build_command = format!(
|
||||||
"{program} --target-env emscripten clone && \
|
"{program} --target-env emscripten clone && \
|
||||||
source {}emsdk_env.sh && \
|
cd {} && . ./emsdk_env.sh && cd .. && \
|
||||||
{program} --target-env emscripten build --llvm-projects clang --llvm-projects lld",
|
{program} --target-env emscripten build --llvm-projects lld",
|
||||||
revive_llvm_builder::LLVMPath::DIRECTORY_EMSDK_SOURCE,
|
revive_llvm_builder::LLVMPath::DIRECTORY_EMSDK_SOURCE,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user