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