Skip to content

Commit

Permalink
Add test job
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIndra55 committed May 12, 2024
1 parent 1bdf2ed commit a4fd3d1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 10 deletions.
48 changes: 38 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,36 @@ name: Build
on: [push, pull_request]

jobs:
test:
runs-on: windows-latest

steps:
# setup
- uses: actions/checkout@v4
with:
submodules: true

- uses: microsoft/[email protected]
- uses: ilammy/msvc-dev-cmd@v1

- name: Download premake5
run: |
curl.exe -o premake5.zip -L https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-windows.zip
tar -xf premake5.zip
- name: Generate project files
run: .\premake5 vs2022 --with-tests

# tests
- name: Build tests
run: MSBuild Tests.vcxproj /p:Configuration=Release /p:Platform=TR7

- name: Test
run: .\bin\TR7\Release\Tests.exe

build:
runs-on: windows-latest
needs: test

steps:
# setup
Expand All @@ -29,16 +57,23 @@ jobs:
run: .\premake5 vs2022

# compile
- name: Build Legend
run: MSBuild /p:Configuration=Release /p:Platform=TR7

- name: Build Anniversary
run: MSBuild /p:Configuration=Release /p:Platform=TRAE

- name: Build Underworld
run: MSBuild /p:Configuration=Release /p:Platform=TR8

- name: Build Legend
run: MSBuild /p:Configuration=Release /p:Platform=TR7

# upload
- uses: actions/upload-artifact@v3
with:
name: Legend
path: |
bin/TR7/Release/TR7-Menu-Hook.asi
bin/TR7/Release/TR7-Menu-Hook.pdb
- uses: actions/upload-artifact@v3
with:
name: Anniversary
Expand All @@ -52,10 +87,3 @@ jobs:
path: |
bin/TR8/Release/TR8-Menu-Hook.asi
bin/TR8/Release/TR8-Menu-Hook.pdb
- uses: actions/upload-artifact@v3
with:
name: Legend
path: |
bin/TR7/Release/TR7-Menu-Hook.asi
bin/TR7/Release/TR7-Menu-Hook.pdb
7 changes: 7 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ project "Tests"
includedirs { "src", "vendor/catch2/extras" }
dofile "vendor.lua"

filter "configurations:Debug"
defines { "DEBUG", "_DEBUG" }

filter "configurations:Release"
defines { "NDEBUG" }
optimize "On"

-- Define this as dummy game
defines { "TR7" }

Expand Down

0 comments on commit a4fd3d1

Please sign in to comment.