Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Travis with GitHub actions #1145

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Makefile
*.log

# local build(s)
build*
/build*

/.vs
/.vscode
Expand Down
Loading