Try new config for gh actions/check #169
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 check with LLVM installation for the three major platforms. | ||
name: Cargo Check | ||
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: | ||
install-llvm: | ||
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 | ||
- source-tracking | ||
- reporting | ||
- file_memmap | ||
- ast-model | ||
- lexer | ||
- parser | ||
- wright_library_defaults | ||
- wright_binary | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
shell: ["bash", "msys2 {0}"] | ||
include: | ||
- os: macos-latest | ||
llvm-install-dir: /opt/homebrew/opt/llvm | ||
exclude: | ||
- os: windows-latest | ||
shell: bash | ||
- os: macos-latest | ||
shell: 'msys2 {0}' | ||
- os: ubuntu-latest | ||
shell: 'msys2 {0}' | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: ${{ matrix.allow-failure || false }} | ||
defaults: | ||
run: | ||
shell: ${{ matrix.shell }} | ||
steps: | ||
# Use MSYS2 on windows to install and check LLVM | ||
- name: Install LLVM 18 (Windows Only) | ||
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 | ||
- name: Install LLVM (Ubuntu Only) | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
# 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 | ||
sudo apt install libpolly-18-dev libz-dev | ||
- name: Install LLVM 18 (Mac Only) | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: brew install llvm@18 | ||
check-llvm-version: | ||
needs: install-llvm | ||
Check failure on line 78 in .github/workflows/cargo-check.yml GitHub Actions / Cargo CheckInvalid workflow file
|
||
steps: | ||
- 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-latest' }} | ||
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 | ||
check: | ||
steps: | ||
- name: Checkout Wright source | ||
uses: actions/checkout@v4 | ||
# Use stable Rust toolchain | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Run cargo check (Mac Only) | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: cargo check --no-default-features -F ${{ matrix.features }} | ||
env: | ||
LLVM_SYS_180_PREFIX: ${{ matrix.llvm-install-dir }} | ||
- name: Run cargo check (Ubuntu & Windows) | ||
if: ${{ matrix.os != 'macos-latest' }} | ||
run: cargo check --no-default-features -F ${{ matrix.features }} |