From ec598a71039ae92cac88bbb277b53d5ed2c0ba17 Mon Sep 17 00:00:00 2001 From: Fabian Terhorst Date: Sun, 14 Apr 2024 18:54:52 +0200 Subject: [PATCH] feat(actions): add workflow --- .github/workflows/compile.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/compile.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 000000000..1541e97cd --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,48 @@ +on: push +jobs: + build: + runs-on: ${{ matrix.config.os }} + strategy: + matrix: + config: + - { + name: linux, + os: ubuntu-20.04, + cc: gcc-9, + cxx: g++-9, + args: -DCMAKE_BUILD_TYPE=RelWithDebInfo, + nethost: nethost-linux, + } + - { + name: windows, + os: windows-latest, + cc: cl, + cxx: cl, + args: -DCMAKE_BUILD_TYPE=RelWithDebInfo -A x64 -T host=x64, + nethost: nethost-windows, + } + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/download-artifact@v3 + with: + name: ${{ matrix.config.nethost }} + path: ./ + - working-directory: ./ + shell: cmake -P {0} + run: | + set(ENV{CC} ${{ matrix.config.cc }}) + set(ENV{CXX} ${{ matrix.config.cxx }}) + file(MAKE_DIRECTORY build) + execute_process( + COMMAND cmake .. ${{ matrix.config.args }} + RESULT_VARIABLE result + WORKING_DIRECTORY build + ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "Bad exit status") + endif() + - working-directory: ./ + shell: bash + run: cmake --build build --config RelWithDebInfo \ No newline at end of file