Skip to content

fix(#14): build script does not rebuild when the LLVM prefix has been… #163

fix(#14): build script does not rebuild when the LLVM prefix has been…

fix(#14): build script does not rebuild when the LLVM prefix has been… #163

Workflow file for this run

name: MacOS Test Suite
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
macos-tests:
name: "LLVM ${{ matrix.llvm-version[0] }} MacOS"
runs-on: ${{ matrix.llvm-version[3] }}
env:
LLVM_INSTALL_PATH: ~/llvm
PLUGINS_PATH: tests/plugins/target/debug
strategy:
matrix:
llvm-version:
- ["11", "11-0", "v11.0.1-rust-1.51/llvm-11.0.1-rust-1.51-macos-x86_64.tar.gz", "macos-13"]
- ["12", "12-0", "v12.0.1-rust-1.55/llvm-lld-12.0.1-rust-1.55-macos-x86_64.tar.gz", "macos-13"]
- ["13", "13-0", "v13.0.0-rust-1.59/llvm-lld-13.0.0-rust-1.59-macos-x86_64.tar.gz", "macos-13"]
- ["14", "14-0", "v14.0.6-rust-1.64/llvm-lld-14.0.6-rust-1.64-macos-x86_64.tar.gz", "macos-13"]
- ["15", "15-0", "v15.0.0-rust-1.65/llvm-lld-15.0.0-rust-1.65-macos-x86_64.tar.gz", "macos-13"]
- ["16", "16-0", "v16.0.2-rust-1.71/llvm-lld-16.0.2-rust-1.71-macos-x86_64.tar.gz", "macos-13"]
- ["17", "17-0", "v17.0.6-rust-1.75/llvm-lld-17.0.6-rust-1.75-macos-x86_64.tar.gz", "macos-13"]
- ["18", "18-0", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-macos-arm64.tar.gz", "macos-latest"]
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup LLVM Installation Path
run: |
mkdir ${{ env.LLVM_INSTALL_PATH }}
echo "$HOME/llvm/bin" >> $GITHUB_PATH
- name: Check LLVM Artifacts In Cache
id: cache-llvm
uses: actions/cache@v3
with:
path: |
${{ env.LLVM_INSTALL_PATH }}/bin/llvm-config
${{ env.LLVM_INSTALL_PATH }}/bin/opt
${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM.dylib
${{ env.LLVM_INSTALL_PATH }}/lib/libLLVM-C.dylib
${{ env.LLVM_INSTALL_PATH }}/include
key: ${{ runner.os }}-llvm-${{ matrix.llvm-version[0] }}
- name: Download LLVM Binaries
if: steps.cache-llvm.outputs.cache-hit != 'true'
run: |
wget --user-agent='GithubCI' -O llvm.tar.gz https://github.com/jamesmth/llvm-project/releases/download/${{ matrix.llvm-version[2] }}
tar -C ~ -xf llvm.tar.gz
- name: Build Tests
run: |
cargo b \
--manifest-path tests/plugins/Cargo.toml \
-p plugin* \
--no-default-features \
--features target-x86,llvm${{ matrix.llvm-version[1] }}
- name: Run Tests
run: |
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin1.dylib" \
--passes="mpass,function(fpass)" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin2.dylib" \
--passes="mpass1,mpass2" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin3.dylib" \
--passes="mpass1,mpass2" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin4.dylib" \
--passes="mpass,function(fpass)" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin5.dylib" \
--passes="mpass,function(fpass)" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin6.dylib" \
--passes="default<O3>" \
tests/test.ll \
-disable-output
opt \
--load-pass-plugin="${{ env.PLUGINS_PATH }}/libplugin7.dylib" \
--passes="lto<O3>" \
tests/test.ll \
-disable-output