Added test target to Makefile and updated workflow definitions
This commit is contained in:
parent
c9f35add85
commit
f18ea43e9e
@ -1,4 +1,4 @@
|
||||
name: macOS-build
|
||||
name: macOS
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -8,11 +8,11 @@ on:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
macOS-build:
|
||||
build:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: make setup
|
||||
run: make setup
|
||||
- name: make
|
||||
run: make
|
||||
- name: make test
|
||||
run: make test
|
@ -1,4 +1,4 @@
|
||||
name: ubuntu-build
|
||||
name: ubuntu
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -8,7 +8,7 @@ on:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
ubuntu-build:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@ -18,5 +18,5 @@ jobs:
|
||||
run: sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev
|
||||
- name: make setup
|
||||
run: make setup
|
||||
- name: make
|
||||
run: make
|
||||
- name: make test
|
||||
run: make test
|
@ -1,5 +1,5 @@
|
||||
|
||||
name: windows-build
|
||||
name: windows
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -9,7 +9,7 @@ on:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
windows-build:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
18
Makefile
18
Makefile
@ -1,5 +1,6 @@
|
||||
# Set general macros
|
||||
buildFile = build/app
|
||||
tempDir = .temp
|
||||
|
||||
# Check for Windows
|
||||
ifeq ($(OS), Windows_NT)
|
||||
@ -27,16 +28,16 @@ else
|
||||
endif
|
||||
|
||||
# Set UNIX commands
|
||||
cleanCommand = rm $(buildFile)
|
||||
mkdirOptions = -p
|
||||
cleanCommand = rm $(buildFile); rm -rf $(tempDir)
|
||||
endif
|
||||
|
||||
run: compile execute clean
|
||||
|
||||
all: setup compile execute clean
|
||||
|
||||
setup: include lib
|
||||
|
||||
test: compile execute check clean
|
||||
|
||||
pull:
|
||||
# Pull and update the the build submodules
|
||||
git submodule init; git submodule update
|
||||
@ -60,9 +61,18 @@ compile:
|
||||
$(compiler) -std=c++17 -I include -L lib/$(platform) src/main.cpp -o $(buildFile) -l raylib $(options)
|
||||
|
||||
execute:
|
||||
$(buildFile)
|
||||
# Run the executable and push the output to a log file
|
||||
mkdir $(mkdirOptions) $(tempDir)
|
||||
$(buildFile) | tee $(tempDir)/execute.log
|
||||
|
||||
clean:
|
||||
# Clean up all relevant files
|
||||
$(cleanCommand)
|
||||
|
||||
check:
|
||||
# Search the execution log for mention of raylib starting
|
||||
$(eval VAR = $(shell grep -c "raylib" $(tempDir)/execute.log))
|
||||
if [[ $(VAR) -gt 0 ]];\
|
||||
then echo "Application was started";\
|
||||
else echo "Application failed to start"; exit 1;\
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user