From c65d87f0ccc35b0b7d309582c23af4dbcdf9ee47 Mon Sep 17 00:00:00 2001 From: Donovan Watteau Date: Fri, 28 Jan 2022 18:54:42 +0100 Subject: [PATCH] feat(ci): Add a basic-compilation-test.yml automated workflow Mainly targeting Linux, Windows (win32 target) and macOS (x64/arm64). --- .editorconfig | 5 ++ .gitattributes | 1 + .github/workflows/basic-compilation-test.yml | 48 ++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/workflows/basic-compilation-test.yml diff --git a/.editorconfig b/.editorconfig index b467a03..a095cac 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,6 +13,11 @@ indent_style = tab tab_width = 8 trim_trailing_whitespace = true +[*.{yml,yaml}] +indent_size = 2 +indent_style = space +trim_trailing_whitespace = true + [Dockerfile*] indent_style = tab tab_width = 8 diff --git a/.gitattributes b/.gitattributes index 0e7681f..c1584d8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,4 +5,5 @@ CMakeLists.txt text eol=lf *.hpp text eol=lf *.md text eol=lf *.sh text eol=lf +*.yml text eol=lf man/txt/*.txt text eol=crlf diff --git a/.github/workflows/basic-compilation-test.yml b/.github/workflows/basic-compilation-test.yml new file mode 100644 index 0000000..1776968 --- /dev/null +++ b/.github/workflows/basic-compilation-test.yml @@ -0,0 +1,48 @@ +name: Basic compilation test for most common platforms + +on: + push: + branches: [ main ] + paths: + - '.github/workflows/basic-compilation-test.yml' + - 'CMakeLists.txt' + - 'src/**' + pull_request: + branches: [ main ] + paths: + - '.github/workflows/basic-compilation-test.yml' + - 'CMakeLists.txt' + - 'src/**' + +env: + BUILD_TYPE: RelWithDebInfo + +jobs: + build: + name: Build on ${{ matrix.name }} + runs-on: ${{ matrix.os }} + + strategy: + matrix: + include: + - name: 'Ubuntu 18.04 (default)' + os: ubuntu-18.04 + extraargs: '' + - name: 'Windows Server 2019 (win32)' + os: windows-2019 + extraargs: '-DCMAKE_GENERATOR_PLATFORM=Win32' + - name: 'macOS 11 (x86_64 and arm64)' + os: macos-11 + extraargs: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' + + steps: + - uses: actions/checkout@v2 + + - name: Print CMake version + run: cmake --version + + - name: Configure for ${{env.BUILD_TYPE}} + run: cmake -S . -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.extraargs }} + + - name: Build + run: cmake --build ${{github.workspace}}/build -j2