Introduce new system Pipeline behavior #419
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
BUILD_TYPE: Release | |
jobs: | |
build: | |
name: "Build on ${{matrix.os}} using ${{matrix.compiler}}" | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
include: | |
## Add GCC compiler to ubuntu | |
- os: ubuntu-22.04 | |
compiler: GCC 12 | |
CC: gcc-12 | |
CXX: g++-12 | |
GCOV: gcov-12 | |
generator: "Unix Makefiles" | |
## Add Clang compiler to ubuntu | |
- os: ubuntu-latest | |
compiler: Clang 15 | |
CC: clang-15 | |
CXX: clang++-15 | |
CXXFLAGS: -stdlib=libstdc++ | |
generator: "Unix Makefiles" | |
- os: windows-latest | |
compiler: MSVC 2022 | |
generator: "Visual Studio 17 2022" | |
steps: | |
- name: Install common unix dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake | |
sudo apt-get install -y libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev | |
echo "CC=${{matrix.CC}}" >> $GITHUB_ENV | |
echo "CXX=${{matrix.CXX}}" >> $GITHUB_ENV | |
if: startsWith(matrix.os, 'ubuntu') | |
## Install gcovr for gnu | |
- name: Install Gcovr | |
run: | | |
sudo apt-get install -y gcovr | |
echo "GCOV=${{matrix.GCOV}}" >> $GITHUB_ENV | |
if: matrix.GCOV | |
## Install clang | |
- name: Install clang | |
run: | | |
sudo apt-get install -y software-properties-common apt-transport-https | |
curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
sudo apt-add-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main' | |
sudo apt-get update | |
sudo apt-get install -y ninja-build clang-14 libc++-14-dev libc++abi-14-dev libstdc++-11-dev | |
echo "CXXFLAGS=${{matrix.compiler.CXXFLAGS}}" >> $GITHUB_ENV | |
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.compiler, 'Clang') | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build | |
-G "${{matrix.generator}}" | |
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | |
-DBUILD_TEST_SUITE=TRUE | |
-DENABLE_COVERAGE=TRUE | |
-DECSTASY_INTEGRATIONS_EVENT=TRUE | |
-DECSTASY_INTEGRATIONS_SFML=TRUE | |
-DECSTASY_INTEGRATIONS_SFML_BUILD_DEMO=TRUE | |
-DECSTASY_INTEGRATIONS_USER_ACTION=TRUE | |
-DECSTASY_SERIALIZER_JSON=TRUE | |
-DECSTASY_THREAD_SAFE=TRUE | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j | |
- name: Run Unit Tests | |
run: cd ${{github.workspace}}/build && ctest -C ${{env.BUILD_TYPE}} --output-on-failure | |
- name: Collect Coverage Files | |
if: matrix.GCOV | |
run: | | |
gcovr -r ${{github.workspace}} --exclude-unreachable-branches --exclude-throw-branches --xml --output ./coverage.xml -e "src/ecstasy/integrations/sfml/*" ${{github.workspace}}/build/src | |
- name: Upload Coverage Data | |
if: matrix.GCOV && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage.xml | |
verbose: true | |
fail_ci_if_error: true |