Tests #262
This file contains hidden or 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: Tests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'include/**/*' | |
- 'tests/**/*' | |
- 'RhythmGameUtilities/**/*' | |
- 'RhythmGameUtilities.Tests/**/*' | |
- '!**/*.md' | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
branches: | |
- main | |
paths: | |
- 'include/**/*' | |
- 'tests/**/*' | |
- 'RhythmGameUtilities/**/*' | |
- 'RhythmGameUtilities.Tests/**/*' | |
- '!**/*.md' | |
workflow_dispatch: | |
jobs: | |
test-cpp: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- name: Check out repository | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Run tests | |
run: ./bin/test.sh | |
test-csharp: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- name: Check out repository | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0 | |
- name: Build Release | |
run: | | |
mkdir -p build | |
g++ -std=c++17 -shared -fPIC -o build/libRhythmGameUtilities.so include/RhythmGameUtilities/RhythmGameUtilities.cpp | |
- name: Copy Release | |
run: | | |
cp build/libRhythmGameUtilities.so UnityPackage/Libs/Linux | |
cp build/libRhythmGameUtilities.so RhythmGameUtilities/Libs/Linux | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Test | |
run: dotnet test RhythmGameUtilities.Tests/*.csproj | |
test-copy: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.draft == false | |
steps: | |
- name: Check out repository | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Copy files from project to UnityPackage | |
run: | | |
(cd RhythmGameUtilities && find . -type f -name "*.cs" -not -path '*/obj/*' -not -path '*/bin/*' -exec cp {} ../UnityPackage/{} \;) | |
(cd RhythmGameUtilities.Tests && find . -type f -name "*.cs" -not -path '*/obj/*' -not -path '*/bin/*' -exec cp {} ../UnityPackage/Editor/Tests/{} \;) | |
cp LICENSE ./UnityPackage/ | |
cp README.md ./RhythmGameUtilities/ | |
cp README.md ./UnityPackage/ | |
cp screenshot.png ./UnityPackage/ | |
- name: Check for changes | |
run: git diff --exit-code |