tools/corrosion/.github/workflows/linux.yaml
author unC0Rr
Wed, 20 Nov 2024 21:37:47 +0100
branchtransitional_engine
changeset 16038 d903f8d2395a
permissions -rw-r--r--
- Update corrosion - Implement installation of targets imported with corrosion
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16038
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
     1
# Workflow file for Linux hosts
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
     2
name: Corrosion on Linux
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
     3
on:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
     4
  workflow_call:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
     5
    inputs:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
     6
      ubuntu_version:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
     7
        required: false
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
     8
        type: string
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
     9
        default: "latest"
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    10
      cmake:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    11
        required: false
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    12
        type: string
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    13
        default: "3.22.6"
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    14
      generator:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    15
        required: true
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    16
        type: string
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    17
      c_compiler:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    18
        required: true
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    19
        type: string
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    20
      rust:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    21
        required: false
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    22
        type: string
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    23
        default: 1.46.0
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    24
      target_arch:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    25
        required: false
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    26
        type: string
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    27
        default: x86_64
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    28
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    29
jobs:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    30
  linux:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    31
    name: Test Linux
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    32
    runs-on: ubuntu-${{ inputs.ubuntu_version }}
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    33
    steps:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    34
      - uses: actions/checkout@v4
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    35
      - name: Install CMake
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    36
        uses: lukka/get-cmake@519de0c7b4812477d74976b2523a9417f552d126
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    37
        with:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    38
          cmakeVersion: "${{ inputs.cmake }}"
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    39
          ninjaVersion: "~1.10.0"
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    40
      - name: Install Rust
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    41
        id: install_rust
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    42
        uses: dtolnay/rust-toolchain@master
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    43
        with:
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    44
          toolchain: ${{inputs.rust}}
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    45
          targets: ${{inputs.target_arch}}-unknown-linux-gnu
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    46
      - name: Install Cross Compiler
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    47
        shell: bash
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    48
        run: |
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    49
          echo "::group::apt-install"
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    50
          sudo apt-get update
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    51
          sudo apt-get install -y "g++-${{inputs.target_arch}}-linux-gnu"
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    52
          echo "::endgroup::"
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    53
        if: ${{ 'Linux' == runner.os && inputs.target_arch != 'x86_64' }}
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    54
      - name: Configure Corrosion
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    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 }}"
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    56
      - name: Run Tests
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    57
        working-directory: build
d903f8d2395a - Update corrosion
unC0Rr
parents:
diff changeset
    58
        run: ctest --output-on-failure --build-config Debug -j 3