mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-27 15:08:00 +00:00
Fix the Wasm build cache (#159)
Follow-ups for https://github.com/paritytech/revive/pull/154 - Fix the cache in the Wasm build - Remove a no longer needed script - The Wasm build job uses parity-large
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
1
|
|
||||||
@@ -9,12 +9,11 @@ on:
|
|||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
REVIVE_WASM_INSTALL_DIR: ${{ github.workspace }}/target/wasm32-unknown-emscripten/release
|
REVIVE_WASM_INSTALL_DIR: ${{ github.workspace }}/target/wasm32-unknown-emscripten/release
|
||||||
EMSCRIPTEN_VERSION: 3.1.64
|
|
||||||
BUN_VERSION: 1.1.43
|
BUN_VERSION: 1.1.43
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-revive-wasm:
|
build-revive-wasm:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: parity-large
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -26,30 +25,43 @@ jobs:
|
|||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
target-llvm
|
target-llvm/emscripten/target-final
|
||||||
|
target-llvm/gnu/target-final
|
||||||
# Use a unique key based on LLVM version or configuration files to avoid cache invalidation
|
# Use a unique key based on LLVM version or configuration files to avoid cache invalidation
|
||||||
key: llvm-build-${{ runner.os }}-${{ hashFiles('LLVM.lock', '.github/trigger-wasm-llvm-build') }}
|
key: llvm-build-${{ runner.os }}-${{ hashFiles('LLVM.lock', 'Cargo.toml', 'Cargo.lock', 'crates/llvm-builder/**', '.github/workflows/build-revive-wasm.yml') }}
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
# system dependencies
|
|
||||||
sudo apt-get update && sudo apt-get install -y cmake ninja-build curl git libssl-dev pkg-config clang lld
|
sudo apt-get update && sudo apt-get install -y cmake ninja-build curl git libssl-dev pkg-config clang lld
|
||||||
rustup target add wasm32-unknown-emscripten
|
|
||||||
# host LLVM
|
- name: Install Rust stable toolchain
|
||||||
curl -sSL --output llvm.tar.xz https://github.com/paritytech/revive/releases/download/v0.1.0-dev.7/clang+llvm-18.1.8-x86_64-linux-gnu-ubuntu-24.04.tar.xz
|
uses: actions-rs/toolchain@v1
|
||||||
mkdir llvm18
|
with:
|
||||||
tar Jxf llvm.tar.xz -C llvm18/
|
profile: minimal
|
||||||
echo "LLVM_SYS_181_PREFIX=$(pwd)/llvm18" >> $GITHUB_ENV
|
toolchain: stable
|
||||||
# Clone LLVM and install the Emscripten SDK
|
components: rust-src
|
||||||
|
target: wasm32-unknown-emscripten
|
||||||
|
|
||||||
|
- name: Install LLVM build dependencies
|
||||||
|
run: |
|
||||||
make install-llvm-builder
|
make install-llvm-builder
|
||||||
revive-llvm --target-env emscripten clone
|
revive-llvm --target-env emscripten clone
|
||||||
|
|
||||||
|
- name: Setup revive environment variables
|
||||||
|
run: |
|
||||||
|
echo "LLVM_SYS_181_PREFIX=$(pwd)/target-llvm/gnu/target-final" >> $GITHUB_ENV
|
||||||
|
echo "REVIVE_LLVM_TARGET_PREFIX=$(pwd)/target-llvm/emscripten/target-final" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build host LLVM
|
||||||
|
if: steps.cache-llvm.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
revive-llvm build
|
||||||
|
|
||||||
- name: Build target LLVM
|
- name: Build target LLVM
|
||||||
if: steps.cache-llvm.outputs.cache-hit != 'true'
|
if: steps.cache-llvm.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
source emsdk/emsdk_env.sh
|
source emsdk/emsdk_env.sh
|
||||||
revive-llvm --target-env emscripten build
|
revive-llvm --target-env emscripten build
|
||||||
echo "REVIVE_LLVM_TARGET_PREFIX=${PWD}/target-llvm/emscripten/target-final" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
rustup show
|
rustup show
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Default directory for cloning the llvm-project repository
|
|
||||||
DEFAULT_DIR="llvm-project"
|
|
||||||
|
|
||||||
# Check if a directory argument is provided
|
|
||||||
if [ $# -eq 1 ]; then
|
|
||||||
DIR=$1
|
|
||||||
else
|
|
||||||
DIR=$DEFAULT_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Clone LLVM 18 (any revision after commit bd32aaa is supposed to work)
|
|
||||||
if [ ! -d "${DIR}" ]; then
|
|
||||||
git clone --depth 1 --branch release/18.x https://github.com/llvm/llvm-project.git "${DIR}"
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user