Attempt 2 on CI #192
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
# Combined cargo test with LLVM installation for the three major platforms. | |
name: Cargo Test | |
on: ["push", "pull_request"] | |
# Cancel in-progress runs for previous commits if there are any that haven't completed yet. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
# Different features to check against on all platforms. Currently each group is one feature, since each | |
# depends on the previous, but more combinations could be added in the future. | |
features: | |
- none | |
- std | |
- supports-unicode | |
- source-tracking | |
- reporting | |
- file_memmap | |
- ast-models | |
- lexer | |
- parser | |
- wright_library_defaults | |
- wright_binary | |
- default | |
os: [ubuntu-24.04, windows-latest, macos-latest] | |
shell: ["bash", "msys2 {0}"] | |
include: | |
- os: macos-latest | |
llvm-install-dir: /opt/homebrew/opt/llvm | |
- targets: --lib | |
- targets: --tests | |
- features: wright_binary | |
targets: --bins | |
- features: default | |
targets: --bins | |
exclude: | |
- os: windows-latest | |
shell: bash | |
- os: macos-latest | |
shell: 'msys2 {0}' | |
- os: ubuntu-24.04 | |
shell: 'msys2 {0}' | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.allow-failure || false }} | |
defaults: | |
run: | |
shell: ${{ matrix.shell }} | |
steps: | |
- name: Checkout Wright source | |
uses: actions/checkout@v4 | |
# Use MSYS2 on windows to install and check LLVM | |
- uses: msys2/setup-msys2@v2 | |
if: ${{ matrix.os == 'windows-latest' }} | |
with: | |
update: true | |
# Use special mingw LLVM package. | |
# Also install the current stable rust | |
install: >- | |
mingw-w64-x86_64-llvm | |
mingw-w64-x86_64-rust | |
# Use stable Rust toolchain | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Install LLVM (Ubuntu Only) | |
if: ${{ matrix.os == 'ubuntu-24.04' }} | |
# See: https://apt.llvm.org/ | |
# Last line: https://gitlab.com/taricorp/llvm-sys.rs/-/issues/13 | |
run: | | |
wget https://apt.llvm.org/llvm.sh | |
chmod +x llvm.sh | |
sudo ./llvm.sh 18 all | |
sudo apt install libpolly-18-dev libz-dev | |
- name: Install LLVM 18 (Mac Only) | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: brew install llvm@18 | |
- name: Get the LLVM version (Windows Only) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: llvm-config --version | |
- name: Get the LLVM version (Mac Only) | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: ${{ matrix.llvm-install-dir }}/bin/llvm-config --version | |
# For some reason, this seems to error even when llvm-config is available somewhere. Leaving it in for now. | |
continue-on-error: true | |
- name: Get the LLVM version (Ubuntu Only) | |
if: ${{ matrix.os == 'ubuntu-24.04' }} | |
run: llvm-config --version | |
# For some reason, this seems to error even when llvm-config is available somewhere. Leaving it in for now. | |
continue-on-error: true | |
- name: Run cargo test (Mac Only) | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: cargo test --no-default-features -F ${{ matrix.features }} ${{ matrix.targets }} | |
env: | |
LLVM_SYS_180_PREFIX: ${{ matrix.llvm-install-dir }} | |
- name: Run cargo test (Ubuntu & Windows) | |
if: ${{ matrix.os != 'macos-latest' }} | |
run: cargo test --no-default-features -F ${{ matrix.features }} ${{ matrix.targets }} |