tools/corrosion/.github/workflows/test.yaml
branchtransitional_engine
changeset 16038 d903f8d2395a
parent 16021 6a3dc15b78b9
equal deleted inserted replaced
16036:7b8d96fc8799 16038:d903f8d2395a
     7     branches:
     7     branches:
     8       - 'master'
     8       - 'master'
     9       - 'stable/**'
     9       - 'stable/**'
    10 jobs:
    10 jobs:
    11 
    11 
    12   test_legacy_linux:
    12   visual_studio_base:
    13     name: Test Corrosion (CMake 3.15)
    13     name: Test Visual Studio (base)
    14     uses: ./.github/workflows/test_legacy.yaml
    14     uses: ./.github/workflows/visual_studio.yaml
    15     with :
    15     with:
    16       os: ubuntu-20.04
    16       vs_version: "2022"
    17       rust: 1.46.0
    17       rust: 1.46.0
    18   test_legacy_mac:
    18 
    19     name: Test Corrosion (CMake 3.15)
    19   visual_studio_stage2:
    20     uses: ./.github/workflows/test_legacy.yaml
    20     name: Test Visual Studio
    21     with:
    21     uses: ./.github/workflows/visual_studio.yaml
    22       os: macos-12
    22     needs:
    23       rust: 1.54.0
    23       - visual_studio_base
    24   test_legacy_windows:
    24     strategy:
    25     name: Test Corrosion (CMake 3.15)
    25       matrix:
    26     uses: ./.github/workflows/test_legacy.yaml
    26         vs_version:
    27     with:
    27           - "2019"
    28       os: windows-2019
    28           - "2022"
    29       rust: 1.46.0
       
    30 
       
    31   test_legacy_stable:
       
    32     name: Legacy CMake + stable Rust
       
    33     uses: ./.github/workflows/test_legacy.yaml
       
    34     strategy:
       
    35       fail-fast: false
       
    36       matrix:
       
    37         os:
       
    38           - windows-2019 # windows-latest is currently not having a supported MSVC compiler
       
    39           - ubuntu-20.04
       
    40           - macos-12
       
    41     with:
       
    42       os: ${{ matrix.os }}
       
    43       rust: stable
       
    44 
       
    45   test_legacy_nightly:
       
    46     name: Legacy CMake + nightly Rust
       
    47     uses: ./.github/workflows/test_legacy.yaml
       
    48     with:
       
    49       os: ubuntu-20.04
       
    50       rust: nightly
       
    51 
       
    52   test_legacy_new_lockfile_msrv:
       
    53     name: Test MSRV of the new lockfile
       
    54     runs-on: ubuntu-20.04
       
    55     steps:
       
    56       - uses: actions/checkout@v4
       
    57       - name: Install Rust
       
    58         id: install_rust
       
    59         uses: dtolnay/rust-toolchain@1.56
       
    60       - name: Test Generator build with MSRV
       
    61         run: cargo build
       
    62         working-directory: generator
       
    63 
       
    64   test:
       
    65     name: Test Corrosion
       
    66     runs-on: ${{ matrix.os }}
       
    67     continue-on-error: ${{ matrix.rust == 'nightly' }}
       
    68     strategy:
       
    69       fail-fast: false
       
    70       matrix:
       
    71         os:
       
    72           - windows-2019 # windows-latest is currently not having a supported MSVC compiler
       
    73           - ubuntu-latest
       
    74           - macos-12
       
    75         arch:
    29         arch:
    76           - x86_64
    30           - x86_64
    77           - i686
    31           - i686
    78           - aarch64
    32           - aarch64
    79           - powerpc64le
       
    80         abi:
       
    81           - gnu
       
    82           - darwin
       
    83           - msvc
       
    84         cmake:
       
    85           - 3.19.0
       
    86         rust:
    33         rust:
    87           # Our MSRV is already tested with the legacy generator, so just test the current stable rust here.
    34           - "1.54.0"
    88           - stable
    35         include:
    89         generator:
    36           - arch: x86_64
    90           - default # This is just whatever the platform default is
    37             vs_version: 2022
    91           - ninja
    38             rust: stable
    92         compiler: [default]
    39           - arch: x86_64
    93         include:
    40             vs_version: 2022
    94           - rust: nightly
    41             rust: nightly
    95             cmake: 3.19.0
    42     with:
    96             generator: ninja
    43       vs_version: "${{ matrix.vs_version}}"
    97             arch: x86_64
    44       rust: 1.54.0
    98             abi: msvc
    45       target_arch: "${{ matrix.arch}}"
    99             os: windows-2019
    46 
   100           - rust: nightly
    47   windows_ninja_cl:
   101             cmake: 3.19.0
    48     name: Test Windows Ninja MSVC
   102             generator: ninja
    49     runs-on: ${{ matrix.os }}
   103             arch: x86_64
    50     needs:
   104             abi: gnu
    51       - visual_studio_base
   105             os: ubuntu-latest
       
   106           - rust: nightly
       
   107             cmake: 3.19.0
       
   108             generator: ninja
       
   109             arch: x86_64
       
   110             abi: darwin
       
   111             os: macos-12
       
   112           - rust: 1.54
       
   113             cmake: 3.19.0
       
   114             generator: ninja
       
   115             arch: x86_64
       
   116             abi: msvc
       
   117             os: windows-2019
       
   118             compiler: clang
       
   119           - os: ubuntu-latest
       
   120             arch: x86_64
       
   121             abi: gnu
       
   122             cmake: 3.20.0
       
   123             rust: 1.54
       
   124             generator: ninja-multiconfig
       
   125 
       
   126         exclude:
       
   127 
       
   128           # We have a separate test Matrix for the Visual Studio Generator
       
   129           - os: windows-2019
       
   130             generator: default # Default generator is Visual Studio
       
   131 
       
   132           # ARCH
       
   133           - os: windows-2019
       
   134             arch: i686
       
   135             abi: gnu
       
   136           - os: windows-2019
       
   137             arch: aarch64
       
   138             abi: gnu
       
   139           - os: windows-2019
       
   140             arch: i686
       
   141             generator: ninja
       
   142           - os: windows-2019
       
   143             arch: aarch64
       
   144             generator: ninja
       
   145           - os: windows-2019
       
   146             arch: powerpc64le
       
   147           - os: macos-12
       
   148             arch: i686
       
   149           - os: macos-12
       
   150             arch: aarch64
       
   151           - os: macos-12
       
   152             arch: powerpc64le
       
   153 
       
   154           # ABI
       
   155           - os: ubuntu-latest
       
   156             abi: msvc
       
   157           - os: ubuntu-latest
       
   158             abi: darwin
       
   159           - os: windows-2019
       
   160             abi: darwin
       
   161           - os: macos-12
       
   162             abi: msvc
       
   163           - os: macos-12
       
   164             abi: gnu
       
   165 
       
   166     steps:
       
   167       - uses: actions/checkout@v4
       
   168       - name: Setup Environment and Configure CMake
       
   169         uses: "./.github/actions/setup_test"
       
   170         with:
       
   171           target_arch: ${{matrix.arch}}
       
   172           abi: ${{matrix.abi}}
       
   173           cmake: ${{matrix.cmake}}
       
   174           rust: ${{matrix.rust}}
       
   175           generator: ${{matrix.generator}}
       
   176           build_dir: build
       
   177           compiler: ${{matrix.compiler}}
       
   178       - name: Run Tests
       
   179         id: run_tests
       
   180         working-directory: build
       
   181         run: ctest --output-on-failure --build-config Debug -j 3
       
   182 
       
   183   test_msvc:
       
   184     name: Test MSVC Generator
       
   185     runs-on: ${{ matrix.os }}
       
   186     strategy:
    52     strategy:
   187       fail-fast: false
    53       fail-fast: false
   188       matrix:
    54       matrix:
   189         os:
    55         os:
   190           - windows-2019
       
   191           - windows-2022
    56           - windows-2022
   192         arch:
    57         arch:
   193           - x86_64
    58           - x86_64
   194           - i686
    59           - i686
   195           - aarch64
    60           - aarch64
   196         include:
    61         compiler:
       
    62           - cl
       
    63           - clang-cl
       
    64           - clang
       
    65         include:
       
    66           - os: windows-2022
       
    67             vs_version: vs-2022
       
    68             cmake: 3.22.6
   197           - rust: 1.54.0
    69           - rust: 1.54.0
   198           # Override rust version for x86_64
    70           # Add variable mapping for ilammy/msvc-dev-cmd action
   199           - arch: x86_64
    71           - arch: x86_64
   200             rust: 1.46.0
    72             msvc_dev_arch: amd64
   201           - os: windows-2019
    73           - arch: i686
   202             cmake: 3.20.6  # Multi-config Generators require at least CMake 3.20
    74             msvc_dev_arch: amd64_x86
   203           - os: windows-2022
    75           - arch: aarch64
   204             cmake: 3.21.5 # VS on windows-2022 requires at least CMake 3.21
    76             msvc_dev_arch: amd64_arm64
   205 
    77         exclude:
   206     steps:
    78           # Not sure what parameters CMake needs when cross-compiling with clang-cl, so exclude for now
   207       - uses: actions/checkout@v4
    79           - compiler: clang-cl
   208       # The initial configure for MSVC is quite slow, so we cache the build directory
    80             arch: i686
   209       # (including the build directories of the tests) since reconfiguring is
    81           - compiler: clang-cl
   210       # significantly faster.
    82             arch: aarch64
   211       - name: Cache MSVC build directory
    83           - compiler: clang
   212         id: cache-msvc-builddir
    84             arch: i686
   213         uses: actions/cache@v4
    85           - compiler: clang
   214         with:
    86             arch: aarch64
   215           path: build
    87 
   216           key: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.rust }}-msvc-build
    88     steps:
   217       - name: Setup Environment and Configure CMake
    89       - uses: actions/checkout@v4
   218         uses: "./.github/actions/setup_test"
    90       - name: Install CMake
   219         with:
    91         uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
   220           target_arch: ${{matrix.arch}}
    92         with:
   221           abi: msvc
    93           cmakeVersion: "${{ matrix.cmake }}"
   222           cmake: ${{matrix.cmake}}
    94           ninjaVersion: "~1.10.0"
   223           rust: ${{matrix.rust}}
    95       - name: Install Rust
   224           generator: default
    96         id: install_rust
   225           build_dir: build
    97         uses: dtolnay/rust-toolchain@master
   226           configure_params: "-DCORROSION_TESTS_KEEP_BUILDDIRS=ON"
    98         with:
       
    99           toolchain: ${{matrix.rust}}
       
   100           targets: ${{matrix.arch}}-pc-windows-msvc
       
   101       - name: Setup MSVC Development Environment
       
   102         uses: ilammy/msvc-dev-cmd@v1
       
   103         with:
       
   104           arch: ${{ matrix.msvc_dev_arch }}
       
   105       - name: Configure
       
   106         run: cmake -S. -Bbuild "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "ninja-${{ matrix.arch }}-pc-windows-msvc-${{ matrix.compiler }}"
   227       - name: Run Tests
   107       - name: Run Tests
   228         working-directory: build
   108         working-directory: build
   229         run: ctest --output-on-failure --build-config Debug -j 3
   109         run: ctest --output-on-failure --build-config Debug -j 3
       
   110 
       
   111   windows_gnu:
       
   112     name: Test Windows GNU
       
   113     runs-on: ${{ matrix.os }}
       
   114     strategy:
       
   115       fail-fast: false
       
   116       matrix:
       
   117         os:
       
   118           - windows-2022
       
   119         arch:
       
   120           - x86_64
       
   121           # - i686
       
   122           # - aarch64
       
   123         compiler:
       
   124           - gcc # Clang only has experimental support for Cygwin / MinGW, so we don't test it
       
   125         generator:
       
   126           - ninja
       
   127           - make
       
   128         include:
       
   129           - cmake: 3.22.6
       
   130           - rust: 1.54.0
       
   131 
       
   132     steps:
       
   133       - uses: actions/checkout@v4
       
   134       - name: Install CMake
       
   135         uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
       
   136         with:
       
   137           cmakeVersion: "${{ matrix.cmake }}"
       
   138           ninjaVersion: "~1.10.0"
       
   139       - name: Install Rust
       
   140         id: install_rust
       
   141         uses: dtolnay/rust-toolchain@master
       
   142         with:
       
   143           toolchain: ${{matrix.rust}}
       
   144           targets: ${{matrix.arch}}-pc-windows-gnu
       
   145       - name: Configure
       
   146         run: cmake -S. -Bbuild "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ matrix.generator }}-${{ matrix.arch }}-pc-windows-gnu-${{ matrix.compiler }}"
       
   147       - name: Run Tests
       
   148         working-directory: build
       
   149         run: ctest --output-on-failure --build-config Debug -j 3
       
   150 
       
   151   windows_gnullvm_msys2:
       
   152     name: Test Windows gnullvm on msys2
       
   153     runs-on: ${{ matrix.os }}
       
   154     strategy:
       
   155       fail-fast: false
       
   156       matrix:
       
   157         os:
       
   158           - windows-2022
       
   159         arch:
       
   160           - x86_64
       
   161           # - i686
       
   162           # - aarch64
       
   163         generator:
       
   164           - Ninja
       
   165           - MSYS Makefiles
       
   166         include:
       
   167           - arch: x86_64
       
   168             msystem: CLANG64
       
   169 #          - arch: i686
       
   170 #            msystem: CLANG32
       
   171 #          - arch: aarch64
       
   172 #            msystem: CLANGARM64
       
   173     defaults:
       
   174       run:
       
   175         shell: msys2 {0}
       
   176     steps:
       
   177       - uses: actions/checkout@v4
       
   178       - name: Install Rust
       
   179         id: install_rust
       
   180         uses: dtolnay/rust-toolchain@master
       
   181         with:
       
   182           toolchain: stable
       
   183           targets: ${{matrix.arch}}-pc-windows-gnullvm
       
   184       - uses: msys2/setup-msys2@v2
       
   185         with:
       
   186           msystem: ${{matrix.msystem}}
       
   187           path-type: inherit
       
   188           install: >-
       
   189             git
       
   190             make
       
   191           pacboy: >-
       
   192             toolchain:p
       
   193             cmake:p
       
   194             ninja:p
       
   195       - name: Configure
       
   196         run: cmake -S. -Bbuild -G "${{matrix.generator}}" --toolchain=.github/scripts/toolchains/${{matrix.arch}}-pc-windows-gnullvm.cmake
       
   197       - name: Run Tests
       
   198         working-directory: build
       
   199         run: ctest --output-on-failure --build-config Debug -j 3
       
   200 
       
   201 # For now just test if hostbuild works when cross-compiling on windows.
       
   202 # For testing everything we would also need to install a cross-compiler first.
       
   203   windows_cross_hostbuild:
       
   204     name: Test Windows Cross
       
   205     runs-on: windows-2022
       
   206     steps:
       
   207       - uses: actions/checkout@v4
       
   208       - name: Install CMake
       
   209         uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
       
   210         with:
       
   211           cmakeVersion: "~3.22.0"
       
   212           ninjaVersion: "~1.10.0"
       
   213       - name: Install Rust
       
   214         id: install_rust
       
   215         uses: dtolnay/rust-toolchain@master
       
   216         with:
       
   217           toolchain: stable
       
   218           targets: aarch64-unknown-linux-gnu
       
   219       - name: Configure
       
   220         run: cmake -S. -Bbuild "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" -DRust_CARGO_TARGET=aarch64-unknown-linux-gnu
       
   221       - name: Run Tests
       
   222         working-directory: build
       
   223         run: ctest --output-on-failure --build-config Debug -R hostbuild
       
   224 
       
   225   linux_base:
       
   226     name: Test Linux (base)
       
   227     uses: ./.github/workflows/linux.yaml
       
   228     with:
       
   229       c_compiler: "gcc"
       
   230       generator: "Ninja"
       
   231 
       
   232   linux_stage2:
       
   233     name: Test Linux
       
   234     needs:
       
   235       - linux_base
       
   236     uses: ./.github/workflows/linux.yaml
       
   237     with:
       
   238       target_arch: "${{ matrix.arch }}"
       
   239       c_compiler: "${{ matrix.compiler }}"
       
   240       generator: "${{ matrix.generator }}"
       
   241     strategy:
       
   242       fail-fast: false
       
   243       matrix:
       
   244         arch:
       
   245           - x86_64
       
   246           - i686
       
   247           - aarch64
       
   248         compiler:
       
   249           - gcc
       
   250         generator:
       
   251           - "Ninja"
       
   252           - "Unix Makefiles"
       
   253         include:
       
   254           # rustc doesn't support cross-compiling with clang out of the box, since
       
   255           # clang requires a --target parameter. Corrosion currently can only pass
       
   256           # this for the top-level crate, so linking of cdylibs that are built as
       
   257           # dependencies of this crate will fail if they exist.
       
   258           # Solutions would be to make cross-compiling with clang work out-of-the-box
       
   259           # in rustc, or working around it in corrosion by adding a linker-wrapper.
       
   260           # For this reason we only test clang with the host target for now.
       
   261           - arch: x86_64
       
   262             compiler: clang
       
   263             generator: "Ninja"
       
   264           - arch: x86_64
       
   265             generator: "Ninja Multi-Config"
       
   266             compiler: gcc
       
   267 
       
   268   darwin:
       
   269     name: Test MacOS
       
   270     runs-on: ${{ matrix.os }}
       
   271     strategy:
       
   272       fail-fast: false
       
   273       matrix:
       
   274         arch:
       
   275           - x86_64
       
   276           - aarch64
       
   277         compiler:
       
   278           - clang
       
   279         generator:
       
   280           - "Ninja"
       
   281           - "Xcode"
       
   282         include:
       
   283           - os: macos-latest
       
   284           - cmake: 3.22.6
       
   285           - rust: 1.54.0
       
   286 
       
   287     steps:
       
   288       - uses: actions/checkout@v4
       
   289       - name: Install CMake
       
   290         uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
       
   291         with:
       
   292           cmakeVersion: "${{ matrix.cmake }}"
       
   293           ninjaVersion: "~1.10.0"
       
   294       # Install cbindgen before Rust to use recent default Rust version.
       
   295       - name: Install cbindgen
       
   296         run: cargo install cbindgen
       
   297       - name: Install Rust
       
   298         id: install_rust
       
   299         uses: dtolnay/rust-toolchain@master
       
   300         with:
       
   301           toolchain: ${{matrix.rust}}
       
   302           targets: ${{matrix.arch}}-apple-darwin
       
   303       - name: Configure
       
   304         run: cmake -S. -Bbuild --log-level=DEBUG -G "${{ matrix.generator }}" "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ matrix.arch }}-apple-darwin-${{ matrix.compiler }}"
       
   305       - name: Run Tests
       
   306         working-directory: build
       
   307         run: ctest --output-on-failure --build-config Debug -j 3
       
   308 
   230 
   309 
   231   test_cxxbridge:
   310   test_cxxbridge:
   232     name: Test cxxbridge integration
   311     name: Test cxxbridge integration
   233     runs-on: ${{ matrix.os }}
   312     runs-on: ${{ matrix.os }}
   234     strategy:
   313     strategy:
   235       fail-fast: false
   314       fail-fast: false
   236       matrix:
   315       matrix:
   237         os:
   316         os:
   238           - windows-2019
   317           - windows-2022
   239           - ubuntu-latest
   318           - ubuntu-latest
   240           - macos-12
   319           - macos-13
   241         include:
   320         include:
   242           - abi: default
   321           # Should be in sync with the `cxx` version the Carg.lock of the cxxbridge tests,
   243         #  - os: windows-2019
   322           # otherwise the caching will not work and the cmd will be built from source.
   244         #    abi: gnu
   323           - cxxbridge_version: "1.0.86"
   245     steps:
   324     steps:
   246       - uses: actions/checkout@v4
   325       - uses: actions/checkout@v4
   247       - uses: actions/cache@v4
   326       - uses: actions/cache@v4
   248         id: cache_cxxbridge
   327         id: cache_cxxbridge
   249         with:
   328         with:
   250           path: "~/.cargo/bin/cxxbridge*"
   329           path: "~/.cargo/bin/cxxbridge*"
   251           key: ${{ runner.os }}-cxxbridge_1_0_86
   330           key: ${{ runner.os }}-cxxbridge_${{ matrix.cxxbridge_version }}
   252       - name: Install cxxbridge
   331       - name: Install cxxbridge
   253         if: steps.cache_cxxbridge.outputs.cache-hit != 'true'
   332         if: steps.cache_cxxbridge.outputs.cache-hit != 'true'
   254         run: cargo install cxxbridge-cmd@1.0.86
   333         run: cargo install cxxbridge-cmd@${{ matrix.cxxbridge_version }}
   255       - name: Install lld
   334       - name: Install lld
   256         run: sudo apt update && sudo apt install -y lld
   335         run: sudo apt update && sudo apt install -y lld
   257         if: ${{ 'Linux' == runner.os }}
   336         if: ${{ 'Linux' == runner.os }}
   258       - name: Setup Environment and Configure CMake
       
   259         uses: "./.github/actions/setup_test"
       
   260         with:
       
   261           target_arch: x86_64
       
   262           cmake: 3.15.7
       
   263           rust: stable minus 2 releases
       
   264           abi: ${{ matrix.abi }}
       
   265           generator: ninja
       
   266           build_dir: build
       
   267           configure_params: -DCORROSION_TESTS_CXXBRIDGE=ON
       
   268       - name: Run Tests
       
   269         working-directory: build
       
   270         run: ctest --output-on-failure --build-config Debug -j 3 -R "^cxxbridge"
       
   271   install:
       
   272     name: Test Corrosion as a Library
       
   273     runs-on: ${{ matrix.os }}
       
   274     strategy:
       
   275       fail-fast: false
       
   276       matrix:
       
   277         os:
       
   278           - windows-2019
       
   279           - ubuntu-latest
       
   280           - macos-12
       
   281         include:
       
   282           - rust: 1.46.0
       
   283           - os: macos-12
       
   284             rust: 1.54.0  # On MacOS-12 linking fails before Rust 1.54
       
   285     steps:
       
   286       - uses: actions/checkout@v4
       
   287       - name: Setup MSVC Development Environment
   337       - name: Setup MSVC Development Environment
   288         uses: ilammy/msvc-dev-cmd@v1
   338         uses: ilammy/msvc-dev-cmd@v1
   289         if: runner.os == 'Windows'
   339         if: runner.os == 'Windows'
   290       - name: Install CMake
   340       - name: Install CMake
   291         uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
   341         uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
   292         with:
   342         with:
   293           cmakeVersion: "~3.18.0"
   343           cmakeVersion: "~3.22.0"
   294           ninjaVersion: "~1.10.0"
   344           ninjaVersion: "~1.10.0"
   295       - name: Install Rust
   345       - name: Install Rust
   296         uses: dtolnay/rust-toolchain@master
   346         uses: dtolnay/rust-toolchain@master
   297         with:
   347         with:
   298           toolchain: ${{matrix.rust}}
   348           toolchain: stable minus 2 releases
   299       - name: CMake Version
   349       - name: Configure
   300         run: cmake --version
       
   301       - name: Rust Version
       
   302         run: rustc --version
       
   303       - name: Test Corrosion as subdirectory
       
   304         run: >
   350         run: >
   305           cmake
   351           cmake
   306           -S.
   352           -S.
   307           -Bbuild
   353           -Bbuild
   308           -GNinja
   354           -GNinja
   309           -DCORROSION_VERBOSE_OUTPUT=ON
   355           -DCORROSION_VERBOSE_OUTPUT=ON
   310           -DCORROSION_TESTS_INSTALL_CORROSION=OFF
   356           -DCORROSION_TESTS_CXXBRIDGE=ON
   311           &&
   357       - name: Run Tests
   312           cd build
   358         working-directory: build
   313           &&
   359         run: ctest --output-on-failure --build-config Debug -j 3 -R "^cxxbridge"
   314           ctest --output-on-failure -C Debug -j 3
   360 
       
   361   autoinstall_cargo_target:
       
   362     name: Test Auto-installing Cargo target via rustup
       
   363     runs-on: ubuntu-22.04
       
   364     steps:
       
   365       - uses: actions/checkout@v4
       
   366       - name: Install CMake
       
   367         uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
       
   368       - name: Install Rust
       
   369         id: install_rust
       
   370         uses: dtolnay/rust-toolchain@stable
       
   371       - name: Install Cross Compiler
       
   372         shell: bash
       
   373         run: |
       
   374           echo "::group::apt-install"
       
   375           sudo apt-get update
       
   376           sudo apt-get install -y gcc-aarch64-linux-gnu
       
   377           echo "::endgroup::"
       
   378       - name: Assert rustup target is not installed
       
   379         run: rustup show | ( ! grep aarch64)
       
   380       - name: Configure Corrosion
       
   381         run: cmake -S. -Bbuild -GNinja -DRust_RUSTUP_INSTALL_MISSING_TARGET=ON --preset "aarch64-unknown-linux-gnu-gcc"
       
   382       - name: Check rustup target is installed after configuring
       
   383         run: rustup show | grep aarch64
       
   384 
       
   385   install:
       
   386     name: Test Corrosion as a Library
       
   387     runs-on: ${{ matrix.os }}
       
   388     strategy:
       
   389       fail-fast: false
       
   390       matrix:
       
   391         os:
       
   392           - windows-2022
       
   393           - ubuntu-latest
       
   394           - macos-13
       
   395         include:
       
   396           - rust: 1.54.0
       
   397 
       
   398     steps:
       
   399       - uses: actions/checkout@v4
       
   400       - name: Setup MSVC Development Environment
       
   401         uses: ilammy/msvc-dev-cmd@v1
       
   402         if: runner.os == 'Windows'
       
   403       - name: Install CMake
       
   404         uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
       
   405         with:
       
   406           cmakeVersion: "~3.22.0"
       
   407           ninjaVersion: "~1.10.0"
       
   408       # Install cbindgen before Rust to use recent default Rust version.
       
   409       - name: Install cbindgen
       
   410         run: cargo install cbindgen
       
   411       - name: Install Rust
       
   412         uses: dtolnay/rust-toolchain@master
       
   413         with:
       
   414           toolchain: ${{matrix.rust}}
   315       - name: Test Corrosion as installed module
   415       - name: Test Corrosion as installed module
   316         run: >
   416         run: >
   317           cmake -E remove_directory build
       
   318           &&
       
   319           cmake
   417           cmake
   320           -S.
   418           -S.
   321           -Bbuild
   419           -Bbuild
   322           -GNinja
   420           -GNinja
   323           -DCORROSION_VERBOSE_OUTPUT=ON
   421           -DCORROSION_VERBOSE_OUTPUT=ON
   325           -DCORROSION_TESTS_INSTALL_CORROSION=ON
   423           -DCORROSION_TESTS_INSTALL_CORROSION=ON
   326           &&
   424           &&
   327           cd build
   425           cd build
   328           &&
   426           &&
   329           ctest --output-on-failure -C Release -j 3
   427           ctest --output-on-failure -C Release -j 3
   330   # We need some "accumulation" job here because bors fails (timeouts) to
   428 
   331   # listen on matrix builds.
   429   # We want an "accumulation" job here because it is easier to specify required
   332   # Hence, we have some kind of dummy here that bors can listen on
   430   # jobs here via needs, then in the github UI, since we use matrix jobs.
   333   ci-success:
   431   ci-success:
   334     name: bors-ci-status
   432     name: bors-ci-status
   335     if: ${{ always() }}
   433     if: ${{ always() }}
   336     needs:
   434     needs:
   337       - test_legacy_linux
   435       - visual_studio_stage2
   338       - test_legacy_mac
   436       - windows_ninja_cl
   339       - test_legacy_windows
   437       - windows_gnu
   340       - test_legacy_stable
   438       - windows_gnullvm_msys2
   341       - test_legacy_new_lockfile_msrv
   439       - linux_stage2
   342       - test
   440       - darwin
   343       - test_msvc
       
   344       - test_cxxbridge
   441       - test_cxxbridge
       
   442       - autoinstall_cargo_target
   345       - install
   443       - install
   346     runs-on: ubuntu-latest
   444     runs-on: ubuntu-latest
   347     # Step copied from: https://github.com/cross-rs/cross/blob/80c9f9109a719ffb0f694060ddc6e371d5b3a540/.github/workflows/ci.yml#L361
   445     # Step copied from: https://github.com/cross-rs/cross/blob/80c9f9109a719ffb0f694060ddc6e371d5b3a540/.github/workflows/ci.yml#L361
   348     steps:
   446     steps:
   349       - name: Result
   447       - name: Result