Skip to content

Commit

Permalink
ci: Add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
flagarde committed Jan 17, 2022
1 parent cc44e34 commit d5efb64
Show file tree
Hide file tree
Showing 6 changed files with 282 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/Linux-Clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
if: hashFiles('.github/workflows/.env') != ''
uses: xom9ikk/[email protected]
with:
path: .github/workflows/
path: .github/workflows

- name: '${{ matrix.icon }} Setup CMake'
uses: jwlawson/[email protected]
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/Linux-GCC.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Linux GCC'

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { icon: '🟨', cc: gcc-7, cxx: g++-7, name: 'GCC 7', gpp : 'g++-7-multilib' }
- { icon: '🟦', cc: gcc-8, cxx: g++-8, name: 'GCC 8', gpp : 'g++-8-multilib' }
- { icon: '🟩', cc: gcc-9, cxx: g++-9, name: 'GCC 9', gpp : 'g++-9-multilib' }
- { icon: '🟥', cc: gcc-10, cxx: g++-10, name: 'GCC 10', gpp : 'g++-10-multilib' }
name: '🚧 ${{ matrix.icon }} ${{ matrix.name }}'

steps:

- name: '🧰 Add toolchains'
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get update

- name: '🧰 Checkout'
uses: actions/[email protected]

- name: '📥 Load .env file'
if: hashFiles('.github/workflows/.env/.env') != ''
uses: xom9ikk/[email protected]
with:
path: .github/workflows

- name: '${{ matrix.icon }} Setup CMake'
uses: jwlawson/[email protected]
with:
cmake-version: '${{env.CMAKE_VERSION}}'
github-api-token: ${{ secrets.GITHUB_TOKEN }}

- name: '${{ matrix.icon }} Install ${{ matrix.cc }}'
run: sudo apt-get install ${{ matrix.cc }} ${{ matrix.gpp }}

- name: '${{ matrix.icon }} Install packages'
if: ${{ env.INSTALL_PACKAGES != '' }}
run: sudo apt-get install ${{env.INSTALL_PACKAGES}}

- name: '🔧 Configure'
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
run: cmake -S . -B ${{ env.CMAKE_BUILD_PREFIX }} -D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DBUILD_TESTS=${{ env.BUILD_TESTS }} -DBUILD_DOCS=${{ env.BUILD_DOCS }} -DBUILD_EXAMPLES=${{ env.BUILD_EXAMPLES }}

- name: '⚙️ Build'
run: cmake --build ${{ env.CMAKE_BUILD_PREFIX }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS }}

- name: '🧪 Run tests'
working-directory: ${{ env.CMAKE_BUILD_PREFIX }}
run: ctest -C ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS_TESTS }} -VV --output-on-failure
45 changes: 45 additions & 0 deletions .github/workflows/MacOS-Clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'MacOS Clang'

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
pull_request:

jobs:
build:
runs-on: macos-latest
name: '🚧 🟨 Clang'

steps:

- name: '🧰 Checkout'
uses: actions/[email protected]

- name: '📥 Load .env file'
if: hashFiles('.github/workflows/.env/.env') != ''
uses: xom9ikk/[email protected]
with:
path: .github/workflows

- name: '🟨 Setup CMake'
uses: jwlawson/[email protected]
with:
cmake-version: '${{env.CMAKE_VERSION}}'
github-api-token: ${{ secrets.GITHUB_TOKEN }}

- name: '🟨 Install packages'
if: ${{ env.INSTALL_PACKAGES != '' }}
run: brew install ${{env.INSTALL_PACKAGES}}

- name: '🔧 Configure'
run: cmake -S ${{ github.workspace }} -B ${{ env.CMAKE_BUILD_PREFIX }} -D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DBUILD_TESTS=${{ env.BUILD_TESTS }} -DBUILD_DOCS=${{ env.BUILD_DOCS }} -DBUILD_EXAMPLES=${{ env.BUILD_EXAMPLES }}

- name: '⚙️ Build'
run: cmake --build ${{ env.CMAKE_BUILD_PREFIX }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS }}

- name: '🧪 Run tests'
working-directory: ${{ env.CMAKE_BUILD_PREFIX }}
run: ctest -C ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS_TESTS }} -VV --output-on-failure
55 changes: 55 additions & 0 deletions .github/workflows/MacOS-GCC.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'MacOS GCC'

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
pull_request:

jobs:
build:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- { icon: '🟨', cc: gcc-9, cxx: g++-9, name: 'GCC 9' }
- { icon: '🟦', cc: gcc-10, cxx: g++-10, name: 'GCC 10' }
- { icon: '🟩', cc: gcc-11, cxx: g++-11, name: 'GCC 11' }
name: '🚧 ${{ matrix.icon }} ${{ matrix.name }}'

steps:

- name: '🧰 Checkout'
uses: actions/[email protected]

- name: '📥 Load .env file'
if: hashFiles('.github/workflows/.env/.env') != ''
uses: xom9ikk/[email protected]
with:
path: .github/workflows

- name: '${{ matrix.icon }} Setup CMake'
uses: jwlawson/[email protected]
with:
cmake-version: '${{env.CMAKE_VERSION}}'
github-api-token: ${{ secrets.GITHUB_TOKEN }}

- name: '🟨 Install packages'
if: ${{ env.INSTALL_PACKAGES != '' }}
run: brew install ${{env.INSTALL_PACKAGES}}

- name: '🔧 Configure'
env:
CC: ${{matrix.cc}}
CXX: ${{matrix.cxx}}
run: cmake -S . -B ${{ env.CMAKE_BUILD_PREFIX }} -D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DBUILD_TESTS=${{ env.BUILD_TESTS }} -DBUILD_DOCS=${{ env.BUILD_DOCS }} -DBUILD_EXAMPLES=${{ env.BUILD_EXAMPLES }}

- name: '⚙️ Build'
run: cmake --build ${{ env.CMAKE_BUILD_PREFIX }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS }}

- name: '🧪 Run tests'
working-directory: ${{ env.CMAKE_BUILD_PREFIX }}
run: ctest -C ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS_TESTS }} -VV --output-on-failure
57 changes: 57 additions & 0 deletions .github/workflows/Windows-MSVC.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: 'Windows MSVC'

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
pull_request:

jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { icon: '🟨', env: Win32, toolset: x86 }
- { icon: '🟦', env: x64, toolset: x64 }
#- { icon: '🟩', env: ARM, toolset: x86 }
#- { icon: '🟥', env: ARM64, toolset: x64 }
name: '🚧 ${{ matrix.icon }} ${{ matrix.env }}'

steps:

- name: '🧰 Checkout'
uses: actions/[email protected]

- name: '📥 Load .env file'
if: hashFiles('.github/workflows/.env/.env') != ''
uses: xom9ikk/[email protected]
with:
path: .github/workflows

- name: '${{ matrix.icon }} Setup CMake'
uses: jwlawson/[email protected]
with:
cmake-version: '${{env.CMAKE_VERSION}}'
github-api-token: ${{ secrets.GITHUB_TOKEN }}

- name: '${{ matrix.icon }} Setup Visual Studio'
uses: ilammy/[email protected]

- name: '${{ matrix.icon }} Install package'
if: ${{ env.INSTALL_PACKAGES != '' }}
run: choco install ${{env.INSTALL_PACKAGES}}

- name: '🔧 Configure'
run: cmake -S ${{ github.workspace }} -B ${{ env.CMAKE_BUILD_PREFIX }} -A ${{matrix.env}} -T host=${{matrix.toolset}} -DBUILD_TESTS=${{ env.BUILD_TESTS }} -DBUILD_DOCS=${{ env.BUILD_DOCS }} -DBUILD_EXAMPLES=${{ env.BUILD_EXAMPLES }}

- name: '⚙️ Build'
run: cmake --build ${{ env.CMAKE_BUILD_PREFIX }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS }}

- name: '🧪 Run tests'
if: ${{ matrix.env != 'ARM' && matrix.env != 'ARM64' }}
working-directory: ${{ env.CMAKE_BUILD_PREFIX }}
run: ctest -C ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS_TESTS }} -VV --output-on-failure
62 changes: 62 additions & 0 deletions .github/workflows/Windows-MSYS2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: 'Windows MSYS2'

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
pull_request:

jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- { icon: '🟨', sys: mingw32, env: i686, name: MINGW32 }
- { icon: '🟦', sys: mingw64, env: x86_64, name: MINGW64 }
- { icon: '🟩', sys: ucrt64, env: ucrt-x86_64, name: UCRT64 } # Experimental!
- { icon: '🟥', sys: clang64, env: clang-x86_64, name: Clang64 } # Experimental!

name: '🚧 ${{ matrix.icon }} ${{ matrix.name }}'
defaults:
run:
shell: msys2 {0}

steps:

- name: '🧰 Checkout'
uses: actions/[email protected]

- name: '📥 Load .env file'
if: hashFiles('.github/workflows/.env/.env') != ''
uses: xom9ikk/[email protected]
with:
path: .github/workflows

- name: '${{ matrix.icon }} Setup MSYS2'
uses: msys2/setup-msys2@v2
with:
msystem: ${{matrix.sys}}
path-type: minimal
release: true
update: true
install: >-
git
make
mingw-w64-${{matrix.env}}-toolchain
mingw-w64-${{matrix.env}}-cmake
mingw-w64-${{matrix.env}}-ninja
pcre
${{env.INSTALL_PACKAGES}}
- name: '🔧 Configure'
run: cmake -S . -B ${{ env.CMAKE_BUILD_PREFIX }} -D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -DBUILD_TESTS=${{ env.BUILD_TESTS }} -DBUILD_DOCS=${{ env.BUILD_DOCS }} -DBUILD_EXAMPLES=${{ env.BUILD_EXAMPLES }}

- name: '⚙️ Build'
run: cmake --build ${{ env.CMAKE_BUILD_PREFIX }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS }}

- name: '🧪 Run tests'
working-directory: ${{ env.CMAKE_BUILD_PREFIX }}
run: ctest -C ${{ env.CMAKE_BUILD_TYPE }} --parallel ${{ env.CMAKE_NUMBER_JOBS_TESTS }} -VV --output-on-failure

0 comments on commit d5efb64

Please sign in to comment.