reactphysics3d/.github/workflows/build-and-test.yml
2021-08-03 23:19:04 +02:00

97 lines
2.8 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Build and run tests for ReactPhysics3D
name: Build and Test ReactPhysics3D
# Controls when the action will run. Triggers the workflow on push
on:
push:
pull_request:
release:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Linux / GCC (Debug, Single Precision)",
os: ubuntu-latest,
artifact: "ubuntu_gcc.7z",
build_type: "Debug",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
generators: "Ninja",
double_precision: false
}
- {
name: "Linux / GCC (Release, Single Precision)",
os: ubuntu-latest,
artifact: "ubuntu_gcc.7z",
build_type: "Release",
cc: "gcc",
cxx: "g++",
archiver: "7z a",
generators: "Ninja",
double_precision: false
}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on Windows
if: startsWith(matrix.config.os, 'windows')
run: |
choco install ninja cmake
ninja --version
cmake --version
# cmd "${{ matrix.config.environment_script }}"
- name: Install dependencies on Linux
if: startsWith(matrix.config.name, 'Linux')
run: |
sudo apt-get update
sudo apt-get install ninja-build cmake
ninja --version
cmake --version
gcc --version
- name: Install dependencies on MacOS
if: startsWith(matrix.config.os, 'macos')
run: |
brew install cmake ninja
ninja --version
cmake --version
- name: CMake Configure
shell: bash
run: |
mkdir build
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-DRP3D_DOUBLE_PRECISION_ENABLED=${{ matrix.config.double_precision }} \
-DRP3D_COMPILE_TESTS=True \
-G "${{ matrix.config.generators }}" \
- name: Build
shell: bash
run: cmake --build build/ --config ${{ matrix.config.build_type }}
- name: Unit Tests
shell: bash
run: ./build/test/tests