tools/corrosion/.github/workflows/linux.yaml
branchtransitional_engine
changeset 16038 d903f8d2395a
equal deleted inserted replaced
16036:7b8d96fc8799 16038:d903f8d2395a
       
     1 # Workflow file for Linux hosts
       
     2 name: Corrosion on Linux
       
     3 on:
       
     4   workflow_call:
       
     5     inputs:
       
     6       ubuntu_version:
       
     7         required: false
       
     8         type: string
       
     9         default: "latest"
       
    10       cmake:
       
    11         required: false
       
    12         type: string
       
    13         default: "3.22.6"
       
    14       generator:
       
    15         required: true
       
    16         type: string
       
    17       c_compiler:
       
    18         required: true
       
    19         type: string
       
    20       rust:
       
    21         required: false
       
    22         type: string
       
    23         default: 1.46.0
       
    24       target_arch:
       
    25         required: false
       
    26         type: string
       
    27         default: x86_64
       
    28 
       
    29 jobs:
       
    30   linux:
       
    31     name: Test Linux
       
    32     runs-on: ubuntu-${{ inputs.ubuntu_version }}
       
    33     steps:
       
    34       - uses: actions/checkout@v4
       
    35       - name: Install CMake
       
    36         uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
       
    37         with:
       
    38           cmakeVersion: "${{ inputs.cmake }}"
       
    39           ninjaVersion: "~1.10.0"
       
    40       - name: Install Rust
       
    41         id: install_rust
       
    42         uses: dtolnay/rust-toolchain@master
       
    43         with:
       
    44           toolchain: ${{inputs.rust}}
       
    45           targets: ${{inputs.target_arch}}-unknown-linux-gnu
       
    46       - name: Install Cross Compiler
       
    47         shell: bash
       
    48         run: |
       
    49           echo "::group::apt-install"
       
    50           sudo apt-get update
       
    51           sudo apt-get install -y "g++-${{inputs.target_arch}}-linux-gnu"
       
    52           echo "::endgroup::"
       
    53         if: ${{ 'Linux' == runner.os && inputs.target_arch != 'x86_64' }}
       
    54       - name: Configure Corrosion
       
    55         run: cmake -S. -Bbuild -G "${{ inputs.generator }}" "-DRust_TOOLCHAIN=${{steps.install_rust.outputs.name}}" --preset "${{ inputs.target_arch }}-unknown-linux-gnu-${{ inputs.c_compiler }}"
       
    56       - name: Run Tests
       
    57         working-directory: build
       
    58         run: ctest --output-on-failure --build-config Debug -j 3