mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-27 18:37:59 +00:00
7ffe64ed7c
- llvm artifacts search, download and extract now in `get-llvm` action - `get-emsdk` action - clone, install, activate emsdk, so we don't need to build `revive-builder` for this - switch workflows to new actions - `concurrency` for remaining workflows (cancel run if new run is triggered) - `target_commitish` for main release, fixes release commit - Run release workflow in PR without creating a release if PR is labeled with `release-test` --------- Co-authored-by: cornholio <0@mcornholio.ru> Co-authored-by: Alexander Theißen <alex.theissen@me.com> Co-authored-by: xermicus <cyrill@parity.io> Co-authored-by: xermicus <bigcyrill@hotmail.com>
109 lines
2.8 KiB
YAML
109 lines
2.8 KiB
YAML
name: Build revive-wasm
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
REVIVE_WASM_INSTALL_DIR: ${{ github.workspace }}/target/wasm32-unknown-emscripten/release
|
|
|
|
jobs:
|
|
build-revive-wasm:
|
|
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
|
|
with:
|
|
toolchain: stable
|
|
components: rust-src
|
|
target: wasm32-unknown-emscripten
|
|
rustflags: ""
|
|
|
|
- name: get llvm gnu
|
|
uses: ./.github/actions/get-llvm
|
|
with:
|
|
artifactArch: x86_64-linux-gnu
|
|
- name: get llvm emscripten
|
|
uses: ./.github/actions/get-llvm
|
|
with:
|
|
artifactArch: emscripten
|
|
|
|
- name: install emsdk
|
|
uses: ./.github/actions/get-emsdk
|
|
|
|
- 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
|
|
|
|
- run: |
|
|
rustup show
|
|
cargo --version
|
|
rustup +nightly show
|
|
cargo +nightly --version
|
|
cmake --version
|
|
bash --version
|
|
|
|
- name: Build revive
|
|
run: |
|
|
source emsdk/emsdk_env.sh
|
|
make install-wasm
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: revive-wasm
|
|
path: |
|
|
${{ env.REVIVE_WASM_INSTALL_DIR }}/resolc.js
|
|
${{ env.REVIVE_WASM_INSTALL_DIR }}/resolc.wasm
|
|
${{ env.REVIVE_WASM_INSTALL_DIR }}/resolc_web.js
|
|
retention-days: 1
|
|
|
|
test-revive-wasm:
|
|
needs: build-revive-wasm
|
|
strategy:
|
|
matrix:
|
|
os: ["ubuntu-24.04", "macos-14", "windows-2022"]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Create Target Directory
|
|
run: mkdir -p ${{ env.REVIVE_WASM_INSTALL_DIR }}
|
|
|
|
- name: Download Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: revive-wasm
|
|
path: ${{ env.REVIVE_WASM_INSTALL_DIR }}
|
|
|
|
- name: Set Up Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install packages
|
|
run: npm install
|
|
|
|
- name: Run Playwright tests
|
|
run: |
|
|
cd js
|
|
npx playwright install --with-deps
|
|
npx playwright test
|
|
|
|
- name: Test revive
|
|
run: |
|
|
echo "Running tests for ${{ matrix.os }}"
|
|
npm run test:wasm
|