Build LLVM for Windows (#248)

This PR changes the CI build scripts to also build LLVM for windows.
**It doesn't build `revive` itself for windows**. This will come in a
follow up. But once we have a LLVM binary release the turn around time
will be much quicker for experimenting with the revive windows build.

I manually uploaded the release those changes produce
[here](https://github.com/paritytech/revive-alex-workflowtest/releases/tag/llvm-18.1.8-revive.22f3ceb).
This enables this PR's CI to find the proper release. This is necessary
because I am also making changes to the folder structure and artifact
naming that the other CI jobs are depending on.

Releases generated from this branch can be inspected here:
https://github.com/paritytech/revive-alex-workflowtest/releases/tag/v0.1.0-dev.12

Summary of changes:
- Change `llvm-builder` to use MSVC toolchain on windows
- Fix `llvm-builder` to work with `.exe` files
- Unify the llvm release jobs into a single one. This removed a lot of
copy pasted code and also speeds up the build by giving each their own
runner.
- Use the LLVM target triple to name the binary releases instead of an
ad-hoc naming convention
- Remove the nested folder hierarchy inside the llvm release. Its just
now a single folder `llvm-<target>` that contains the toolchain.
- Give jobs and workflows consistent names
- Replace all runners bei their `*-latest` counterpart
- Only use `parity-large` to build llvm now. All other jobs use github
runners
This commit is contained in:
Alexander Theißen
2025-02-28 15:06:03 +01:00
committed by GitHub
parent 93788e72e9
commit 2fb8beee62
16 changed files with 340 additions and 446 deletions
+71 -110
View File
@@ -1,5 +1,4 @@
name: Release LLVM
on:
workflow_dispatch:
inputs:
@@ -9,15 +8,15 @@ on:
description: llvm version in "x.x.x" format, e.g. "18.1.8"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
create-release:
runs-on: ubuntu-latest
create-release-draft:
runs-on: ubuntu-24.04
permissions:
contents: write
outputs:
@@ -27,145 +26,107 @@ jobs:
run: |
echo "version=llvm-${{ inputs.llvm_version }}-revive.${GITHUB_SHA:0:7}" >> $GITHUB_OUTPUT
- name: create release
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: "LLVM binaries release: ${{ steps.resolve-version.outputs.version }}"
body: "This release includes binaries of LLVM, used to compile revive itself"
make_latest: "false"
name: ${{ steps.resolve-version.outputs.version }}
body: "LLVM is a dependency of revive. The LLVM releases are used by our CI to build revive."
draft: true
tag_name: ${{ steps.resolve-version.outputs.version }}
build-macos:
build:
strategy:
matrix:
os: [macos-14, macos-13]
target: [x86_64-unknown-linux-gnu, x86_64-unknown-linux-musl, wasm32-unknown-emscripten, aarch64-apple-darwin, x86_64-apple-darwin, x86_64-pc-windows-msvc]
include:
- os: macos-13
arch: x64
- os: macos-14
arch: arm64
needs: create-release
runs-on: ${{ matrix.os }}
name: "build-macos-${{ matrix.arch }}"
- target: x86_64-unknown-linux-gnu
builder-arg: gnu
host: linux
runner: parity-large
- target: x86_64-unknown-linux-musl
builder-arg: musl
host: linux
runner: parity-large
- target: wasm32-unknown-emscripten
builder-arg: emscripten
host: linux
runner: parity-large
- target: aarch64-apple-darwin
builder-arg: gnu
host: macos
runner: macos-14
- target: x86_64-apple-darwin
builder-arg: gnu
host: macos
runner: macos-13
- target: x86_64-pc-windows-msvc
builder-arg: gnu
host: windows
runner: windows-2022
needs: create-release-draft
runs-on: ${{ matrix.runner }}
env:
RUST_LOG: trace
permissions:
contents: write # for uploading assets to release
steps:
- uses: actions/checkout@v4
- name: install macos deps
run: |
brew install ninja
- name: versions
run: |
rustup show
cargo --version
cmake --version
echo "bash:" && bash --version
echo "ninja:" && ninja --version
echo "clang:" && clang --version
- name: Build LLVM
run: |
make install-llvm
- name: clean
# check removed files
run: |
cd target-llvm/gnu/target-final/bin/
rm diagtool llvm-libtool-darwin llvm-lipo llvm-pdbutil llvm-dwarfdump llvm-nm llvm-readobj llvm-cfi-verify \
sancov llvm-debuginfo-analyzer llvm-objdump llvm-profgen llvm-extract llvm-jitlink llvm-c-test llvm-gsymutil llvm-dwp \
dsymutil llvm-dwarfutil llvm-exegesis lli clang-rename bugpoint clang-extdef-mapping clang-refactor c-index-test \
llvm-reduce llvm-lto clang-linker-wrapper llc llvm-lto2
- name: package artifacts
run: |
tar -czf "${{ needs.create-release.outputs.version }}-macos-${{ matrix.arch }}.tar.gz" target-llvm/gnu/target-final
- name: upload archive to release
uses: softprops/action-gh-release@v2
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
make_latest: "false"
tag_name: ${{ needs.create-release.outputs.version }}
files: |
${{ needs.create-release.outputs.version }}-macos-${{ matrix.arch }}.tar.gz
# without this it will override our rust flags
rustflags: ""
cache-key: ${{ matrix.target }}
build-linux-all:
needs: create-release
runs-on: parity-large
env:
RUST_LOG: trace
permissions:
contents: write # for uploading assets to release
steps:
- uses: actions/checkout@v4
- name: install linux deps
- name: Install Dependencies
if: ${{ matrix.host == 'linux' }}
run: |
sudo apt-get update && sudo apt-get install -y cmake ninja-build curl git libssl-dev pkg-config clang lld musl
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rust-src
target: wasm32-unknown-emscripten
rustflags: ""
- name: versions
- name: Install Dependencies
if: ${{ matrix.host == 'macos' }}
run: |
rustup show
cargo --version
cmake --version
echo "bash:" && bash --version
echo "ninja:" && ninja --version
echo "clang:" && clang --version
brew install ninja
- name: Build host LLVM
- name: Install LLVM Builder
run: |
make install-llvm
cargo install --path crates/llvm-builder
- name: Build gnu LLVM
- name: Clone LLVM
run: |
revive-llvm clone
revive-llvm build --llvm-projects lld --llvm-projects clang
revive-llvm --target-env ${{ matrix.builder-arg }} clone
- name: Build musl LLVM
- name: Build LLVM
if: ${{ matrix.target != 'wasm32-unknown-emscripten' }}
run: |
revive-llvm --target-env musl build --llvm-projects lld --llvm-projects clang
revive-llvm --target-env ${{ matrix.builder-arg }} build --llvm-projects lld --llvm-projects clang
- name: Build emscripten LLVM
- name: Build LLVM
if: ${{ matrix.target == 'wasm32-unknown-emscripten' }}
run: |
revive-llvm --target-env emscripten clone
source emsdk/emsdk_env.sh
revive-llvm --target-env emscripten build --llvm-projects lld
revive-llvm --target-env ${{ matrix.builder-arg }} build --llvm-projects lld
- name: clean
# check removed files
- name: Remove Unnecessary Binaries
shell: bash
run: |
for target in gnu emscripten musl; do
cd target-llvm/${target}/target-final/bin/
rm -rf diagtool llvm-libtool-darwin llvm-lipo llvm-pdbutil llvm-dwarfdump llvm-nm llvm-readobj llvm-cfi-verify \
sancov llvm-debuginfo-analyzer llvm-objdump llvm-profgen llvm-extract llvm-jitlink llvm-c-test llvm-gsymutil llvm-dwp \
dsymutil llvm-dwarfutil llvm-exegesis lli clang-rename bugpoint clang-extdef-mapping clang-refactor c-index-test \
llvm-reduce llvm-lto clang-linker-wrapper llc llvm-lto2 llvm-otool llvm-readelf
cd -
done
cd target-llvm/${{ matrix.builder-arg }}/target-final/bin/
rm -f diagtool* llvm-libtool-darwin* llvm-lipo* llvm-pdbutil* llvm-dwarfdump* llvm-nm* llvm-readobj* llvm-cfi-verify* \
sancov* llvm-debuginfo-analyzer* llvm-objdump* llvm-profgen* llvm-extract* llvm-jitlink* llvm-c-test* llvm-gsymutil* llvm-dwp* \
dsymutil* llvm-dwarfutil* llvm-exegesis* lli clang-rename* bugpoint* clang-extdef-mapping* clang-refactor* c-index-test* \
llvm-reduce* llvm-lto* clang-linker-wrapper* llc* llvm-lto2* llvm-otool* llvm-readelf* \
clang-repl* clang-check* clang-scan-deps*
cd -
- name: package artifacts
- name: Package Artifact
shell: bash
run: |
tar -czf "${{ needs.create-release.outputs.version }}-x86_64-linux-gnu-linux.tar.gz" target-llvm/gnu/target-final
tar -czf "${{ needs.create-release.outputs.version }}-x86_64-linux-musl.tar.gz" target-llvm/musl/target-final
tar -czf "${{ needs.create-release.outputs.version }}-wasm32-unknown-emscripten.tar.gz" target-llvm/emscripten/target-final
mv target-llvm/${{ matrix.builder-arg }}/target-final/ llvm-${{ matrix.target }}
tar -czf "${{ needs.create-release-draft.outputs.version }}-${{ matrix.target }}.tar.gz" llvm-${{ matrix.target }}
- name: upload archive to release
- name: Add Artifact to Release
uses: softprops/action-gh-release@v2
with:
make_latest: "false"
tag_name: ${{ needs.create-release.outputs.version }}
tag_name: ${{ needs.create-release-draft.outputs.version }}
draft: true
files: |
${{ needs.create-release.outputs.version }}-x86_64-linux-gnu-linux.tar.gz
${{ needs.create-release.outputs.version }}-x86_64-linux-musl.tar.gz
${{ needs.create-release.outputs.version }}-wasm32-unknown-emscripten.tar.gz
${{ needs.create-release-draft.outputs.version }}-${{ matrix.target }}.tar.gz
+104 -189
View File
@@ -1,23 +1,22 @@
name: Release
run-name: Release ${{ github.ref_name }}
on:
push:
branches:
- "main"
branches: ["main"]
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled]
branches: ["main"]
types: [opened, synchronize, labled, unlabled]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
#rust-musl-cross:x86_64-musl
CARGO_TERM_COLOR: always
RUST_MUSL_CROSS_IMAGE: messense/rust-musl-cross@sha256:68b86bc7cb2867259e6b233415a665ff4469c28b57763e78c3bfea1c68091561
RUST_LOG: trace
jobs:
tag:
check-version-changed:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'release-test')
runs-on: ubuntu-24.04
permissions:
@@ -27,13 +26,11 @@ jobs:
PKG_VER: ${{ steps.versions.outputs.PKG_VER }}
RELEASE_NOTES: ${{ steps.versions.outputs.RELEASE_NOTES }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-tags: "true"
fetch-depth: 0
fetch-tags: true
- name: Versions
- name: Check Versions
id: versions
run: |
export CURRENT_TAG=$(git describe --tags --abbrev=0 --exclude "llvm-*")
@@ -62,190 +59,112 @@ jobs:
echo "$RELEASE_NOTES" >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
build-macos:
build:
strategy:
matrix:
os: [macos-14, macos-13]
target: [x86_64-unknown-linux-musl, aarch64-apple-darwin, x86_64-apple-darwin]
include:
- os: macos-13
arch: x64
- os: macos-14
arch: arm64
if: ${{ needs.tag.outputs.TAG == 'new' }}
runs-on: ${{ matrix.os }}
name: build-macos
needs: [tag]
- target: x86_64-unknown-linux-musl
type: musl
runner: ubuntu-24.04
- target: aarch64-apple-darwin
type: native
runner: macos-14
- target: x86_64-apple-darwin
type: native
runner: macos-13
if: ${{ needs.check-version-changed.outputs.TAG == 'new' }}
runs-on: ${{ matrix.runner }}
needs: [check-version-changed]
steps:
- uses: actions/checkout@v4
- name: get llvm
uses: ./.github/actions/get-llvm
with:
releasePrefix: llvm-
artifactArch: macos-${{ matrix.arch }}
dir: ./
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rust-src
target: wasm32-unknown-emscripten
# without this it will override our rust flags
rustflags: ""
cache-key: ${{ matrix.target }}
- name: install macos deps
run: |
brew install ninja
- name: Download LLVM
uses: ./.github/actions/get-llvm
with:
target: ${{ matrix.target }}
- name: versions
- name: Build
if: ${{ matrix.type == 'native' }}
run: |
rustup show
cargo --version
cmake --version
echo "bash:" && bash --version
echo "ninja:" && ninja --version
echo "clang:" && clang --version
- name: build revive
run: |
export LLVM_SYS_181_PREFIX=$PWD/target-llvm/gnu/target-final
export LLVM_SYS_181_PREFIX=$PWD/llvm-${{ matrix.target }}
make install-bin
cp ./target/release/resolc ./target/release/resolc-${{ matrix.arch }}
mv target/release/resolc resolc-${{ matrix.target }}
- name: check revive
- name: Build
if: ${{ matrix.type == 'musl' }}
run: |
mkdir solc
curl -sSLo solc/solc https://github.com/ethereum/solidity/releases/download/v0.8.28/solc-macos
chmod +x solc/solc
PATH=$PWD/solc:$PATH
result=$(./target/release/resolc-${{ matrix.arch }} --bin crates/integration/contracts/flipper.sol)
echo $result
if [[ $result == *'0x50564d'* ]]; then exit 0; else exit 1; fi
- uses: actions/upload-artifact@v4
with:
name: "revive-macos-${{ matrix.arch }}"
path: |
./target/release/resolc-${{ matrix.arch }}
retention-days: 1
macos-universal-binary:
runs-on: macos-14
needs: [build-macos]
steps:
- uses: actions/download-artifact@v4
with:
pattern: revive-macos-*
path: revive-macos
- name: run lipo
run: |
lipo revive-macos/revive-macos-arm64/resolc-arm64 revive-macos/revive-macos-x64/resolc-x64 -create -output resolc-macos
chmod +x resolc-macos
- name: compress macos artifact
run: |
tar -czf resolc-macos.tar.gz ./resolc-macos
- uses: actions/upload-artifact@v4
with:
name: resolc-macos.tar.gz
path: |
resolc-macos.tar.gz
retention-days: 1
build-linux-all:
if: ${{ needs.tag.outputs.TAG == 'new' }}
runs-on: parity-large
needs: [tag]
steps:
- uses: actions/checkout@v4
- name: install linux deps
run: |
sudo apt-get update && sudo apt-get install -y cmake ninja-build \
curl git libssl-dev pkg-config clang lld musl
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rust-src
target: wasm32-unknown-emscripten
rustflags: ""
- name: versions
run: |
rustup show
cargo --version
cmake --version
echo "bash:" && bash --version
echo "ninja:" && ninja --version
echo "clang:" && clang --version
- name: get llvm musl
uses: ./.github/actions/get-llvm
with:
releasePrefix: llvm-
artifactArch: x86_64-linux-musl
dir: ./
# Build revive
- name: build musl
run: |
mkdir resolc-out
docker run -v $PWD:/opt/revive $RUST_MUSL_CROSS_IMAGE /bin/bash -c "
cd /opt/revive
chown -R root:root .
apt update && apt upgrade -y && apt install -y pkg-config
export LLVM_SYS_181_PREFIX=/opt/revive/target-llvm/musl/target-final
export LLVM_SYS_181_PREFIX=/opt/revive/llvm-${{ matrix.target }}
make install-bin
cp /root/.cargo/bin/resolc /opt/revive/resolc-out/resolc-static-linux
mv target/${{ matrix.target }}/release/resolc resolc-${{ matrix.target }}
"
sudo chown -R $(id -u):$(id -g) .
- name: check musl
- name: Install Solc
uses: ./.github/actions/get-solc
- name: Basic Sanity Check
run: |
mkdir solc
curl -sSLo solc/solc https://github.com/ethereum/solidity/releases/download/v0.8.28/solc-static-linux
chmod +x solc/solc
PATH=$PWD/solc:$PATH
result=$(./resolc-out/resolc-static-linux --bin crates/integration/contracts/flipper.sol)
result=$(./resolc-${{ matrix.target }} --bin crates/integration/contracts/flipper.sol)
echo $result
if [[ $result == *'0x50564d'* ]]; then exit 0; else exit 1; fi
- name: compress musl artifact
run: |
tar -czf $(pwd)/resolc-static-linux.tar.gz -C ./resolc-out resolc-static-linux
- uses: actions/upload-artifact@v4
with:
name: resolc-static-linux.tar.gz
path: |
resolc-static-linux.tar.gz
name: resolc-${{ matrix.target }}
path: resolc-${{ matrix.target }}
retention-days: 1
build-wasm:
if: ${{ needs.check-version-changed.outputs.TAG == 'new' }}
runs-on: ubuntu-24.04
needs: [check-version-changed]
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: wasm32-unknown-emscripten
# without this it will override our rust flags
rustflags: ""
- name: Download Host LLVM
uses: ./.github/actions/get-llvm
with:
target: x86_64-unknown-linux-gnu
- name: Download Wasm LLVM
uses: ./.github/actions/get-llvm
with:
target: wasm32-unknown-emscripten
- name: Download EMSDK
uses: ./.github/actions/get-emsdk
- name: Build
run: |
export LLVM_SYS_181_PREFIX=$PWD/llvm-x86_64-unknown-linux-gnu
export REVIVE_LLVM_TARGET_PREFIX=$PWD/llvm-wasm32-unknown-emscripten
source emsdk/emsdk_env.sh
make install-wasm
chmod -x ./target/wasm32-unknown-emscripten/release/resolc.wasm
- name: Set Up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
node-version: "20"
- name: get llvm emscripten
uses: ./.github/actions/get-llvm
with:
artifactArch: emscripten
- name: install emsdk
uses: ./.github/actions/get-emsdk
- name: build wasm
run: |
export LLVM_SYS_181_PREFIX=$PWD/target-llvm/musl/target-final
export REVIVE_LLVM_TARGET_PREFIX=$PWD/target-llvm/emscripten/target-final
source emsdk/emsdk_env.sh
rustup target add wasm32-unknown-emscripten
make install-wasm
chmod -x ./target/wasm32-unknown-emscripten/release/resolc.wasm
- name: check wasm
- name: Basic Sanity Check
run: |
mkdir -p solc
curl -sSLo solc/soljson.js https://github.com/ethereum/solidity/releases/download/v0.8.28/soljson.js
node -e "
const soljson = require('solc/soljson');
@@ -281,44 +200,41 @@ jobs:
if(!bytecode.startsWith('50564d')) { process.exit(1); }
"
- name: compress wasm artifact
- name: Compress Artifact
run: |
tar -czf $(pwd)/resolc-wasm.tar.gz -C ./target/wasm32-unknown-emscripten/release/ \
tar -czf $(pwd)/resolc-wasm32-unknown-emscripten.tar.gz -C ./target/wasm32-unknown-emscripten/release/ \
resolc.js \
resolc.wasm \
resolc_web.js
- uses: actions/upload-artifact@v4
with:
name: resolc-wasm.tar.gz
path: |
resolc-wasm.tar.gz
name: resolc-wasm32-unknown-emscripten.tar.gz
path: resolc-wasm32-unknown-emscripten.tar.gz
retention-days: 1
create-release:
if: github.event_name != 'pull_request'
needs: [tag, build-linux-all, macos-universal-binary]
runs-on: ubuntu-24.04
needs: [check-version-changed, build-wasm]
runs-on: macos-14
permissions:
contents: write
steps:
- name: Download revive-wasm
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: resolc-wasm.tar.gz
path: resolc-wasm/
merge-multiple: true
- name: Download revive-linux
uses: actions/download-artifact@v4
with:
name: resolc-static-linux.tar.gz
path: resolc-linux/
- name: Create macOS Fat Binary
run: |
lipo resolc-aarch64-apple-darwin resolc-x86_64-apple-darwin -create -output resolc-universal-apple-darwin
- name: Download revive-macos
uses: actions/download-artifact@v4
with:
name: resolc-macos.tar.gz
path: resolc-macos/
- name: Compress Artifacts
run: |
chmod +x resolc-x86_64-unknown-linux-musl
chmod +x resolc-universal-apple-darwin
tar -czf resolc-x86_64-unknown-linux-musl.tar.gz resolc-x86_64-unknown-linux-musl
tar -czf resolc-universal-apple-darwin.tar.gz resolc-universal-apple-darwin
- name: create-release
uses: softprops/action-gh-release@v2
@@ -328,12 +244,11 @@ jobs:
# Note for macOS Users
The macOS binary is unsigned and it needs to be made runnable using `xattr -c resolc-macos`.
tag_name: ${{ needs.tag.outputs.PKG_VER }}
name: ${{ needs.tag.outputs.PKG_VER }}
tag_name: ${{ needs.check-version-changed.outputs.PKG_VER }}
name: ${{ needs.check-version-changed.outputs.PKG_VER }}
draft: true
target_commitish: ${{ github.sha }}
files: |
./resolc-linux/resolc-static-linux.tar.gz
./resolc-macos/resolc-macos.tar.gz
./resolc-wasm/resolc-wasm.tar.gz
resolc-x86_64-unknown-linux-musl.tar.gz
resolc-universal-apple-darwin.tar.gz
resolc-wasm32-unknown-emscripten.tar.gz
@@ -1,43 +1,45 @@
name: Test LLVM Builder
on:
pull_request:
types: [assigned, opened, synchronize, reopened]
branches: ["main"]
types: [opened, synchronize]
paths:
- 'LLVM.lock'
- 'crates/llvm-builder/**'
- '.github/workflows/revive-llvm-test.yml'
- '.github/workflows/test-llvm-builder.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
runner: [parity-large, macos-14, macos-13]
runner: [parity-large, macos-14, windows-2022]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# without this it will override our rust flags
rustflags: ""
cache-key: ${{ matrix.runner }}
- name: Install apt dependencies
- name: Install 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'
- name: Install Dependencies
if: matrix.runner == 'macos-14'
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
- name: Test
run: make test-llvm-builder
env:
RUST_LOG: trace
@@ -1,10 +1,10 @@
name: Build revive-wasm
name: Test Wasm Version
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -15,48 +15,38 @@ env:
REVIVE_WASM_INSTALL_DIR: ${{ github.workspace }}/target/wasm32-unknown-emscripten/release
jobs:
build-revive-wasm:
build:
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install Rust stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rust-src
target: wasm32-unknown-emscripten
# without this it will override our rust flags
rustflags: ""
- name: get llvm gnu
- name: Download Host LLVM
uses: ./.github/actions/get-llvm
with:
artifactArch: x86_64-linux-gnu
- name: get llvm emscripten
uses: ./.github/actions/get-llvm
with:
artifactArch: emscripten
target: x86_64-unknown-linux-gnu
- name: install emsdk
- name: Download Wasm LLVM
uses: ./.github/actions/get-llvm
with:
target: wasm32-unknown-emscripten
- name: Install emsdk
uses: ./.github/actions/get-emsdk
- name: Setup revive environment variables
- name: Set LLVM 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
echo "LLVM_SYS_181_PREFIX=$(pwd)/llvm-x86_64-unknown-linux-gnu" >> $GITHUB_ENV
echo "REVIVE_LLVM_TARGET_PREFIX=$(pwd)/llvm-wasm32-unknown-emscripten" >> $GITHUB_ENV
- run: |
rustup show
cargo --version
rustup +nightly show
cargo +nightly --version
cmake --version
bash --version
- name: Build revive
- name: Build Revive
run: |
source emsdk/emsdk_env.sh
make install-wasm
@@ -70,8 +60,8 @@ jobs:
${{ env.REVIVE_WASM_INSTALL_DIR }}/resolc_web.js
retention-days: 1
test-revive-wasm:
needs: build-revive-wasm
test:
needs: build
strategy:
matrix:
os: ["ubuntu-24.04", "macos-14", "windows-2022"]
@@ -93,7 +83,7 @@ jobs:
with:
node-version: "20"
- name: Install packages
- name: Install Node Packages
run: npm install
- name: Run Playwright tests
@@ -1,10 +1,10 @@
name: Build
name: Test
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -14,27 +14,28 @@ env:
CARGO_TERM_COLOR: always
jobs:
build-ubuntu-x86:
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# without this it will override our rust flags
rustflags: ""
- name: Install solc
- name: Install Solc
uses: ./.github/actions/get-solc
- name: Download LLVM
uses: ./.github/actions/get-llvm
with:
target: x86_64-unknown-linux-gnu
- name: Set LLVM Environment Variables
run: |
mkdir -p solc
curl -sSL --output solc/solc https://github.com/ethereum/solidity/releases/download/v0.8.28/solc-static-linux
chmod +x solc/solc
echo "$(pwd)/solc/" >> $GITHUB_PATH
echo "LLVM_SYS_181_PREFIX=$(pwd)/llvm-x86_64-unknown-linux-gnu" >> $GITHUB_ENV
- name: Install LLVM
run: |
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
mkdir llvm18
tar Jxf llvm.tar.xz -C llvm18/
echo "LLVM_SYS_181_PREFIX=$(pwd)/llvm18" >> $GITHUB_ENV
- name: Install geth
- name: Install Geth
run: |
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt update
@@ -56,9 +57,3 @@ jobs:
- name: Test CLI
run: make test-cli
- uses: actions/upload-artifact@v4
with:
name: ${{ github.job }}-resolc
path: ./target/release/resolc
retention-days: 1