llvm-ir 0.11.3

LLVM IR in natural Rust data structures
Documentation
name: CI

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  test:
    name: Test for LLVM ${{ matrix.llvm }}

    runs-on: ubuntu-20.04

    strategy:
      fail-fast: false
      matrix:
        llvm:
        - 9
        - 10
        - 11
        - 12
        - 13
        - 14
        - 15
        - 16
        - 17
        - 18
        - 19

    steps:
      - name: Checkout sources
        uses: actions/checkout@v3

      - name: Install LLVM ${{ matrix.llvm }}
        run: curl https://apt.llvm.org/llvm.sh | sudo bash  -s -- ${{ matrix.llvm }}

      - name: Install Polly ${{ matrix.llvm }}
        run: sudo apt-get install -y libpolly-${{ matrix.llvm }}-dev
        if: matrix.llvm >= 14

      - name: Install zstd
        run: sudo apt-get install -y libzstd-dev
        if: matrix.llvm >= 16

      - name: Install Rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable

      - name: Build Debug
        uses: actions-rs/cargo@v1
        with:
          command: build
          # LLVM 11 doesn't work with strict-versioning, see #53
          args: ${{ format('--features=llvm-{0}{1}', matrix.llvm, matrix.llvm != '11' && ',strict-versioning' || '') }}

      - name: Build Release
        uses: actions-rs/cargo@v1
        with:
          command: build
          # LLVM 11 doesn't work with strict-versioning, see #53
          args: ${{ format('--release --features=llvm-{0}{1}', matrix.llvm, matrix.llvm != '11' && ',strict-versioning' || '') }}

      - name: Test Release
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: ${{ format('--release --features=llvm-{0}{1}', matrix.llvm, matrix.llvm != '11' && ',strict-versioning' || '') }}

        # LLVM 19 tests should pass with a debug build, now that https://github.com/llvm/llvm-project/issues/65227
        # and https://github.com/llvm/llvm-project/pull/87163 have landed in a release
      - name: Test Debug
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --features=llvm-${{ matrix.llvm }}
        if: matrix.llvm >= 19