From 494912ce8ad967c478810f36d987769523fc3f4d Mon Sep 17 00:00:00 2001 From: Green Sky Date: Mon, 13 Dec 2021 18:59:20 +0100 Subject: [PATCH] wip gh workflows TODO: windows is broken --- .github/workflows/cmake.yml | 70 +++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 0000000..e553365 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,70 @@ +name: CMake + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Debug + +jobs: + linux: + timeout-minutes: 10 + + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. + # You can convert this to a matrix build if you need cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + # TODO: cache + + - name: Install Dependencies + run: sudo apt update && sudo apt -y install libsdl2-dev + + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 + + #- name: Test + #working-directory: ${{github.workspace}}/build + ## Execute tests defined by the CMake configuration. + ## See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail + #run: ctest -C ${{env.BUILD_TYPE}} --output-on-failure + + # TODO: for some reason vcpkg find sdl does not work, despite the find_package REQUIRE not failing + #windows: + #timeout-minutes: 10 + + #runs-on: windows-latest + + #steps: + #- uses: actions/checkout@v2 + #with: + #submodules: recursive + + ## TODO: cache + + #- name: Install Dependencies + #run: vcpkg install sdl2:x64-windows + + ## setup vs env + #- uses: ilammy/msvc-dev-cmd@v1 + #with: + #arch: amd64 + + #- name: Configure CMake + #run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake + + #- name: Build + #run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 +