Fix CI #272
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: [push, pull_request, workflow_dispatch] | |
| jobs: | |
| linux: | |
| strategy: | |
| matrix: | |
| os: | |
| - { name: Ubuntu 22.04, distro: ubuntu-22.04, gcc_version: 11 } | |
| - { name: Ubuntu 24.04, distro: ubuntu-24.04, gcc_version: 13 } | |
| build_type: [Debug, Release] | |
| toolchain: ["gcc-32bit", "gcc-64bit"] | |
| name: "${{matrix.os.name}} ${{matrix.build_type}} ${{matrix.toolchain}}" | |
| runs-on: ${{matrix.os.distro}} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Install dependencies | |
| shell: bash | |
| run: sudo apt-get install gcc g++ gcc-multilib libstdc++-${{matrix.os.gcc_version}}-dev lib32stdc++-${{matrix.os.gcc_version}}-dev | |
| - name: Create build environment | |
| working-directory: ${{runner.workspace}} | |
| run: mkdir build | |
| - name: Initialize CMake | |
| shell: bash | |
| env: | |
| CC: /usr/bin/gcc | |
| CXX: /usr/bin/g++ | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE=toolchains/${{matrix.toolchain}}.cmake | |
| - name: Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: make | |
| - name: Test | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: ctest -V -C ${{matrix.build_type}} | |
| - name: Rename library artifact | |
| run: mv ${{runner.workspace}}/build/src/libgluasteal.so ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-gcc${{matrix.os.gcc_version}}-${{matrix.toolchain}}-${{matrix.build_type}}-${{github.sha}}.so | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: gluasteal-${{matrix.os.distro}}-gcc${{matrix.os.gcc_version}}-${{matrix.toolchain}}-${{matrix.build_type}}-${{github.sha}} | |
| path: ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-gcc${{matrix.os.gcc_version}}-${{matrix.toolchain}}-${{matrix.build_type}}-${{github.sha}}.so | |
| if-no-files-found: error | |
| retention-days: 14 | |
| windows: | |
| strategy: | |
| matrix: | |
| os: | |
| - { name: Windows Server 2019, distro: windows-2019 } | |
| - { name: Windows Server 2022, distro: windows-2022 } | |
| build_type: [Debug, Release] | |
| arch: [Win32, x64] | |
| name: "${{matrix.os.name}} ${{matrix.build_type}} ${{matrix.arch}}" | |
| runs-on: ${{matrix.os.distro}} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Create build environment | |
| working-directory: ${{runner.workspace}} | |
| run: mkdir build | |
| - name: Initialize CMake | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake -A ${{matrix.arch}} -DCMAKE_TOOLCHAIN_FILE=../toolchains/msvc.cmake $env:GITHUB_WORKSPACE | |
| - name: Build | |
| working-directory: ${{runner.workspace}}/build | |
| run: msbuild gluasteal.sln /p:Configuration=${{matrix.build_type}} /p:Platform=${{matrix.arch == 'x86' && 'Win32' || matrix.arch}} | |
| - name: Test | |
| working-directory: ${{runner.workspace}}/build | |
| run: ctest -V -C ${{matrix.build_type}} --timeout 60 | |
| - name: Rename library artifact | |
| run: move ${{runner.workspace}}/build/src/${{matrix.build_type}}/gluasteal.dll ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-${{matrix.arch}}-${{matrix.build_type}}-${{github.sha}}.dll | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: gluasteal-${{matrix.os.distro}}-${{matrix.arch}}-${{matrix.build_type}}-${{github.sha}} | |
| path: ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-${{matrix.arch}}-${{matrix.build_type}}-${{github.sha}}.dll | |
| if-no-files-found: error | |
| retention-days: 14 | |
| macos: | |
| strategy: | |
| matrix: | |
| os: | |
| - { name: "macOS 15 Intel", distro: macos-15-intel } | |
| build_type: [Debug, Release] | |
| toolchain: ["gcc-macos-x86_64"] | |
| name: "${{matrix.os.name}} ${{matrix.build_type}} ${{matrix.toolchain}}" | |
| runs-on: ${{matrix.os.distro}} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Create build environment | |
| working-directory: ${{runner.workspace}} | |
| run: mkdir build | |
| - name: Initialize CMake | |
| env: | |
| CC: /usr/bin/gcc | |
| CXX: /usr/bin/g++ | |
| working-directory: ${{runner.workspace}}/build | |
| run: cmake --debug-output $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCMAKE_TOOLCHAIN_FILE=toolchains/${{matrix.toolchain}}.cmake | |
| - name: Build | |
| shell: bash | |
| working-directory: ${{runner.workspace}}/build | |
| run: make | |
| - name: Test | |
| working-directory: ${{runner.workspace}}/build | |
| shell: bash | |
| run: ctest -V -C ${{matrix.build_type}} | |
| - name: Rename library artifact | |
| run: mv ${{runner.workspace}}/build/src/libgluasteal.dylib ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-${{matrix.toolchain}}-${{matrix.build_type}}-${{github.sha}}.dylib | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: gluasteal-${{matrix.os.distro}}-${{matrix.toolchain}}-${{matrix.build_type}}-${{github.sha}} | |
| path: ${{runner.workspace}}/build/gluasteal-${{matrix.os.distro}}-${{matrix.toolchain}}-${{matrix.build_type}}-${{github.sha}}.dylib | |
| if-no-files-found: error | |
| retention-days: 14 | |