diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-10 17:01:30 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-10 22:17:43 +0100 |
commit | 0e23ba9e5a565e34fee0f024e29ce162f420ec22 (patch) | |
tree | eeaf0ec198ba8849117c9c21675a651e8c93acad /.github/workflows | |
parent | 67f0ff04d0fb71255d35bf7f31a684d7a2120c2a (diff) |
add github action
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/build-windows.bat | 3 | ||||
-rw-r--r-- | .github/workflows/cmake.yml | 53 |
2 files changed, 56 insertions, 0 deletions
diff --git a/.github/workflows/build-windows.bat b/.github/workflows/build-windows.bat new file mode 100644 index 00000000..4571683e --- /dev/null +++ b/.github/workflows/build-windows.bat @@ -0,0 +1,3 @@ +set path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\CMake\bin;C:\Program Files\Git\cmd;%GITHUB_WORKSPACE%/ninja-build +"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" >nul && %* +exit /b %ERRORLEVEL% diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000..b603e0fb --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,53 @@ +name: CMake + +on: + push: + branches: [ master ] + tags: + - '*' + pull_request: + branches: [ master ] + +env: + BUILD_TYPE: RELEASE + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, windows-latest, macos-12] + include: + - os: ubuntu-22.04 + cmake: /usr/bin/env CC=gcc-12 CXX=g++-12 cmake + - os: macos-12 + cmake: /usr/bin/env CC="$(brew --prefix llvm@14)/bin/clang" CXX="$(brew --prefix llvm@14)/bin/clang++" cmake + - os: windows-latest + cmake: .\.github\workflows\build-windows.bat cmake + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - uses: abdes/gha-setup-ninja@master + with: + version: 1.11.1 + if: matrix.os != 'ubuntu-22.04' + + - name: Install Linux Dependencies + run: sudo /bin/sh -c 'set -e; apt update; apt install libopencv-dev libgl-dev g++-12 ninja-build' + if: matrix.os == 'ubuntu-22.04' + + - name: Configure + run: ${{matrix.cmake}} -G "Ninja" -S ${{github.workspace}}/ -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + run: ${{matrix.cmake}} --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install + +# - name: Upload build +# uses: actions/upload-artifact@v2.2.4 +# with: +# name: buildoutput +# path: ${{github.workspace}}/build/ |