Dependencies test #24
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
name: Dependencies test | |
on: | |
workflow_dispatch: | |
inputs: | |
dependencies_list: | |
description: 'Space-separated list of dependencies to update. Example: "era-compiler-common era-compiler-llvm-context"' | |
required: true | |
default: '' | |
type: string | |
dependencies_branch: | |
description: 'Branch of testing dependencies' | |
required: true | |
default: '' | |
type: string | |
jobs: | |
dependencies-check: | |
runs-on: matterlabs-ci-runner-high-performance | |
container: | |
image: ghcr.io/matter-labs/zksync-llvm-runner:latest | |
steps: | |
# Ref to checkout will be defined automatically from the event that triggered the workflow | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Patch dependencies | |
shell: bash -ex {0} | |
env: | |
CARGO_TOML: Cargo.toml | |
GH_ML_URL: https://github.com | |
# `www.github.com` is a workaround for Cargo issue with `patch` section from `git` source | |
# https://github.com/rust-lang/cargo/issues/5478 | |
GH_ML_PATCHED_URL: https://www.github.com | |
run: | | |
for DEP in ${{ inputs.dependencies_list }}; do | |
CRATE=$(echo "${DEP}" | cut -d'/' -f2) | |
# Handle special cases | |
if [ ${DEP} == "matter-labs-forks/llvm-sys.rs" ]; then | |
CRATE="llvm-sys" | |
fi | |
echo "[patch.\"${GH_ML_URL}/${DEP}\"]" >> "${CARGO_TOML}" | |
echo "${CRATE} = { git = '${GH_ML_PATCHED_URL}/${DEP}', branch = '${{ inputs.dependencies_branch }}' }" >> "${CARGO_TOML}" | |
done | |
cat "${CARGO_TOML}" | |
- name: Build LLVM | |
uses: matter-labs/era-compiler-ci/.github/actions/build-llvm@v1 | |
with: | |
enable-assertions: 'true' | |
build-type: RelWithDebInfo | |
ccache-key: ${{ format('llvm-{0}-{1}-gnu', runner.os, runner.arch) }} | |
save-ccache: 'false' | |
- name: Run tests | |
uses: matter-labs/era-compiler-ci/.github/actions/rust-unit-tests@v1 |