Skip to content

Commit

Permalink
added separate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gk646 committed May 12, 2024
1 parent ff03724 commit 128e2f4
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 60 deletions.
58 changes: 0 additions & 58 deletions .github/workflows/BuildAndTest.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/RunTestsGNU-Linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CMake Build for GNU/Linux

on:
push:
branches:
- main

jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4

- name: Cache CMake builds
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/build
key: ${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt', '**/*.cpp', '**/*.h') }}
restore-keys: |
${{ runner.os }}-build-
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y wayland-protocols

- name: Configure CMake
run: cmake -B build -DCMAKE_CXX_COMPILER=gcc -DCMAKE_C_COMPILER=gcc -DCMAKE_BUILD_TYPE=Release -DRN_ENABLE_SANITIZER=OFF -DRN_BUILD_TESTS=ON -S .
working-directory: ${{ github.workspace }}

- name: Build
run: cmake --build build --config Release
working-directory: ${{ github.workspace }}

- name: Run Tests
run: ctest -C Release --output-on-failure
working-directory: ${{ github.workspace }}/build

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Results
path: ${{ github.workspace }}/build/Testing/**/*.xml
42 changes: 42 additions & 0 deletions .github/workflows/RunTestsWindows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CMake Build for Windows

on:
push:
branches:
- main

jobs:
build-and-test:
runs-on: windows-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4

- name: Cache CMake builds
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/build
key: ${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt', '**/*.cpp', '**/*.h') }}
restore-keys: |
${{ runner.os }}-build-
- name: Configure CMake
run: cmake -B build -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -DCMAKE_BUILD_TYPE=Release -DRN_ENABLE_SANITIZER=OFF -DRN_BUILD_TESTS=ON -S .
working-directory: ${{ github.workspace }}
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"

- name: Build
run: cmake --build build --config Release
working-directory: ${{ github.workspace }}

- name: Run Tests
run: ctest -C Release --output-on-failure
working-directory: ${{ github.workspace }}/build

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Test Results
path: ${{ github.workspace }}/build/Testing/**/*.xml
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
.idea
saves
test/res/__GEN1__.rn
test/res/__GEN2__.rn
.github/workflows/BuildAndTest.yml
test/res/__GEN2__.rn

0 comments on commit 128e2f4

Please sign in to comment.