feat: add llvm 19 support #249
Workflow file for this run
This file contains hidden or 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: 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 | |
| TEST_PLUGINS_PATH: tests/plugins/target/debug | |
| EX_PLUGINS_PATH: target/debug/examples | |
| 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-1", "v18.1.2-rust-1.78/llvm-lld-18.1.2-rust-1.78-macos-arm64.tar.gz", "macos-latest"] | |
| - ["19", "19-1", "v19.1.5-rust-1.84/llvm-lld-19.1.5-rust-1.84-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.TEST_PLUGINS_PATH }}/libplugin1.dylib" \ | |
| --passes="mpass,function(fpass)" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.TEST_PLUGINS_PATH }}/libplugin2.dylib" \ | |
| --passes="mpass1,mpass2" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.TEST_PLUGINS_PATH }}/libplugin3.dylib" \ | |
| --passes="mpass1,mpass2" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.TEST_PLUGINS_PATH }}/libplugin4.dylib" \ | |
| --passes="mpass,function(fpass)" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.TEST_PLUGINS_PATH }}/libplugin5.dylib" \ | |
| --passes="mpass,function(fpass)" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.TEST_PLUGINS_PATH }}/libplugin6.dylib" \ | |
| --passes="default<O3>" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.TEST_PLUGINS_PATH }}/libplugin7.dylib" \ | |
| --passes="lto<O3>" \ | |
| tests/test.ll \ | |
| -disable-output | |
| - name: Build Examples | |
| run: | | |
| cargo b \ | |
| --examples \ | |
| --features llvm${{ matrix.llvm-version[1] }} | |
| - name: Run Examples | |
| run: | | |
| opt \ | |
| --load-pass-plugin="${{ env.EX_PLUGINS_PATH }}/libhello_world.dylib" \ | |
| --passes="hello-world" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.EX_PLUGINS_PATH }}/libopcode_counter.dylib" \ | |
| --passes="opcode-counter-printer" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.EX_PLUGINS_PATH }}/libinject_printf.dylib" \ | |
| --passes="inject-func-call" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.EX_PLUGINS_PATH }}/libstatic_call_counter.dylib" \ | |
| --passes="static-cc-printer" \ | |
| tests/test.ll \ | |
| -disable-output | |
| opt \ | |
| --load-pass-plugin="${{ env.EX_PLUGINS_PATH }}/libstring_obf.dylib" \ | |
| --passes="string-obfuscator-pass" \ | |
| tests/test.ll \ | |
| -disable-output |