Skip to content

Commit

Permalink
c.i.: Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Dec 16, 2023
1 parent 586a402 commit f8d61b6
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/actions/build-and-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and test

inputs:
build_dir:
description: "The build dir to use"
required: true
std:
description: "The C++ standard to use"
required: true
build_type:
description: "The build type to use"
default: Debug
sse3:
description: "Whether to enable sse3"
default: OFF
avx:
description: "Whether to enable avx"
default: OFF
pure:
description: "Whether to enable pure"
default: OFF
lang_extensions:
description: "Whether to enable lang extensions"
default: OFF

runs:
using: "composite"
steps:
- name: Build GLM
shell: bash
run: |
mkdir -p ${{ inputs.build_dir }}
cmake -DCMAKE_INSTALL_PREFIX=$RUNNER_TEMP/install \
-DCMAKE_BUILD_TYPE=${{ inputs.build_type }} \
-DGLM_TEST_ENABLE=ON \
-DGLM_TEST_ENABLE_CXX_${{ inputs.std}}=ON \
-DGLM_TEST_ENABLE_SIMD_SSE3=${{ inputs.sse3 }} \
-DGLM_TEST_ENABLE_SIMD_AVX=${{ inputs.avx }} \
-DGLM_TEST_FORCE_PURE=${{ inputs.pure }} \
-DGLM_TEST_ENABLE_LANG_EXTENSIONS=${{ inputs.lang_extensions }} \
-S . \
-B ${{ inputs.build_dir }}
cmake --build ${{ inputs.build_dir }} --parallel 2
- name: Run tests
shell: bash
run:
ctest --test-dir ${{ inputs.build_dir }} --output-on-failure --parallel 4
78 changes: 78 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: GLM tests

on: [push]

jobs:
test:
name: "${{ matrix.os}} ${{ matrix.cxx }} C++:${{ matrix.std }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
cxx: [g++, clang++]
std: [11, 14, 17]
os: [ubuntu-latest, macos-latest]

exclude:
- os: macos-latest
cxx: g++

env:
CXX: ${{ matrix.cxx }}

steps:
- uses: actions/checkout@v3

- name: Tool versions
run: |
${CXX} --version
cmake --version
- name: Standard build
uses: ./.github/actions/build-and-test
with:
build_dir: build
std: ${{ matrix.std }}

- name: SSE3 build
uses: ./.github/actions/build-and-test
with:
build_dir: build_sse3
std: ${{ matrix.std }}
sse3: ON

- name: AVX build
uses: ./.github/actions/build-and-test
with:
build_dir: build_avx
std: ${{ matrix.std }}
avx: ON

- name: Pure build
uses: ./.github/actions/build-and-test
with:
build_dir: build_pure
std: ${{ matrix.std }}
pure: ON

- name: Lang extensions build
uses: ./.github/actions/build-and-test
with:
build_dir: build_lang_extensions
std: ${{ matrix.std }}
lang_extensions: ON

- name: release build
uses: ./.github/actions/build-and-test
with:
build_dir: build_release
std: ${{ matrix.std }}
build_type: Release

- name: Test installing and using GLM
run: |
cmake --build build --target install
mkdir build_test_cmake
cmake -DCMAKE_PREFIX_PATH=$RUNNER_TEMP/install -S ./test/cmake -B build_test_cmake
cmake --build build_test_cmake
./build_test_cmake/test_find_glm

0 comments on commit f8d61b6

Please sign in to comment.