Skip to content

Commit

Permalink
Improved CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Epixu committed Sep 15, 2023
1 parent 111c0ec commit ae30271
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 27 deletions.
67 changes: 40 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name: Langulus::Math CI
on: [push, pull_request, repository_dispatch] # Trigger on pushes to all branches and for all pull-requests
on: [push, repository_dispatch]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false # do not abort on a failed job
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-latest]
build: [Release]
arch: [x86, x64]
cxx: [g++, clang++, cl]
feature: [
[SSE, 16, '-msse', '/arch:SSE'],
[SSE2, 16, '-msse2', '/arch:SSE2'],
Expand All @@ -23,92 +24,104 @@ jobs:
[AVX2, 32, '-mavx2', '/arch:AVX2'],
[AVX512, 64, '-mavx512f', '/arch:AVX512']
]
compiler: [g++, clang++, cl]
exclude:
- os: ubuntu-22.04
compiler: cl
- os: ubuntu-22.04
arch: x86
cxx: cl
- os: windows-latest
compiler: g++
cxx: g++
- os: windows-latest
compiler: clang++
cxx: clang++
- arch: x64
compiler: cl
cxx: cl
feature: [SSE, 16, '-msse', '/arch:SSE']
- arch: x64
compiler: cl
cxx: cl
feature: [SSE2, 16, '-msse2', '/arch:SSE2']
- arch: x64
compiler: cl
cxx: cl
feature: [SSE3, 16, '-msse3', '/arch:SSE3']
- arch: x64
compiler: cl
cxx: cl
feature: [SSSE3, 16, '-mssse3', '/arch:SSSE3']
- arch: x64
compiler: cl
cxx: cl
feature: [SSE4.1, 16, '-msse4.1', '/arch:SSE4.1']
- arch: x64
compiler: cl
cxx: cl
feature: [SSE4.2, 16, '-msse4.2', '/arch:SSE4.2']
- arch: x86
compiler: cl
cxx: cl
feature: [SSE3, 16, '-msse3', '/arch:SSE3']
- arch: x86
compiler: cl
cxx: cl
feature: [SSSE3, 16, '-mssse3', '/arch:SSSE3']
- arch: x86
compiler: cl
cxx: cl
feature: [SSE4.1, 16, '-msse4.1', '/arch:SSE4.1']
- arch: x86
compiler: cl
cxx: cl
feature: [SSE4.2, 16, '-msse4.2', '/arch:SSE4.2']

# Seems the cloud at github doesn't have the avx512 extensions
- feature: [AVX512, 64, '-mavx512f', '/arch:AVX512']

include:
- os: ubuntu-22.04
cmake_args: ""
arch: x86
cmake_args: "-DCMAKE_CXX_FLAGS=-m32"
- os: ubuntu-22.04
arch: x64
cmake_args: "-DCMAKE_CXX_FLAGS=-m64"
- os: windows-latest
arch: x86
cmake_args: "-G \"Visual Studio 17 2022\" -A Win32"
- os: windows-latest
arch: x64
cmake_args: "-G \"Visual Studio 17 2022\" -A x64"

name: "${{matrix.os}}-${{matrix.compiler}}-${{matrix.build}}-${{matrix.arch}}-${{matrix.feature[0]}}"
name: "${{matrix.os}}-${{matrix.cxx}}-${{matrix.build}}-${{matrix.arch}}-${{matrix.feature[0]}}"
runs-on: ${{matrix.os}}
steps:
- name: Dispatch Trigger
if: ${{ startsWith(github.event.action, 'Dependency') }}
run: >
echo "Triggered by dependency: ${{github.event.client_payload.cause}}"
- name: Clone
uses: actions/checkout@v3

- if: matrix.os == 'ubuntu-22.04' && matrix.arch == 'x86'
name: Prepare Linux for cross-compilation
run: |
sudo apt update
sudo apt install g++-multilib
- if: matrix.os == 'ubuntu-22.04'
name: Configure Linux
name: Configure (Linux)
run: >
cmake
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
-DCMAKE_CXX_COMPILER=${{matrix.cxx}}
-S .
-B out
${{matrix.cmake_args}}
-DCMAKE_BUILD_TYPE=${{matrix.build}}
-DCMAKE_CXX_FLAGS="${{matrix.feature[2]}}"
-DLANGULUS_ALIGNMENT=${{matrix.feature[1]}}
${{matrix.cmake_args}}
- if: matrix.os == 'windows-latest'
name: Configure Windows
name: Configure (Windows)
run: >
cmake
-DCMAKE_CXX_COMPILER=${{matrix.compiler}}
-DCMAKE_CXX_COMPILER=${{matrix.cxx}}
-S .
-B out
${{matrix.cmake_args}}
-DCMAKE_BUILD_TYPE=${{matrix.build}}
-DCMAKE_CXX_FLAGS="/DWIN32 /D_WINDOWS /EHsc ${{matrix.feature[3]}}"
-DCMAKE_CXX_FLAGS="${{matrix.feature[3]}}"
-DLANGULUS_ALIGNMENT=${{matrix.feature[1]}}
${{matrix.cmake_args}}
- name: Build
run: cmake --build out --config ${{matrix.build}}

- name: Test
run: cd out && ctest -V -C ${{matrix.build}}
1 change: 1 addition & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
dependents: [Entity]
name: Trigger Langulus::${{matrix.dependents}}'s workflow
Expand Down

0 comments on commit ae30271

Please sign in to comment.