Skip to content

Commit

Permalink
test updates (#89)
Browse files Browse the repository at this point in the history
* test updates

* Remove platformer test for now and use working dir on build

* Add editor test hopefully

* update

* cleanup
  • Loading branch information
Kyjor authored Feb 11, 2025
1 parent eb5a5d3 commit ade2c16
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 29 deletions.
58 changes: 54 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: CI
on:
- push
- pull_request

# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
Expand All @@ -18,20 +24,64 @@ jobs:
- windows-latest
arch:
- x64
- x86
exclude:
- os: macOS-latest
arch: x86
#- x86
#exclude:
#- os: macOS-latest
# arch: x86
steps:
- uses: actions/checkout@v2
- run: sudo apt-get install xvfb && Xvfb :99 &
if: matrix.os == 'ubuntu-latest'

- name: Install PulseAudio on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y pulseaudio
pulseaudio --check || pulseaudio --start
pactl load-module module-null-sink sink_name=vspeaker sink_properties=device.description=virtual_speaker
pactl load-module module-remap-source master=vspeaker.monitor source_name=vmic source_properties=device.description=virtual_mic
- name: Install BlackHole on macOS
if: matrix.os == 'macos-latest'
run: |
brew install blackhole-2ch
- name: Install Scream on Windows
if: matrix.os == 'windows-latest'
shell: powershell
run: |
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/4.0/Scream4.0.zip -OutFile Scream4.0.zip
Expand-Archive -Path Scream4.0.zip -DestinationPath Scream
openssl req -batch -verbose -x509 -newkey rsa -keyout ScreamCertificate.pvk -out ScreamCertificate.cer -nodes -extensions v3_req
openssl pkcs12 -export -nodes -in ScreamCertificate.cer -inkey ScreamCertificate.pvk -out ScreamCertificate.pfx -passout pass:
- name: Setup MSVC Dev Cmd
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1

- name: Sign and Install Scream Driver on Windows
if: matrix.os == 'windows-latest'
shell: powershell
run: |
signtool sign /v /fd SHA256 /f ScreamCertificate.pfx Scream\Install\driver\x64\Scream.cat
Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\root
Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\TrustedPublisher
Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream
timeout-minutes: 5

- name: Start Windows Audio Service
if: matrix.os == 'windows-latest'
run: net start audiosrv
shell: powershell

- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- name: Test Editor Package
working-directory: ./src/editor/JulGameEditor
run: julia -e 'using Pkg; Pkg.activate("."); Pkg.add(path=joinpath("..","..","..")); Pkg.test();'
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4-beta
env:
Expand Down
6 changes: 1 addition & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ version = "0.1.0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
SimpleDirectMediaLayer = "98e33af6-2ee5-5afd-9e75-cbc738b767c4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
julia = "^1.9"
JSON3 = "^1"
SimpleDirectMediaLayer = "^0.5"
Test = "^1"

[extras]
CImGui = "5d785b6c-b76f-510e-a07c-3070796c7e87"
NativeFileDialog = "e1fe445b-aa65-4df4-81c1-2041507f0fd4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "NativeFileDialog", "CImGui"]
test = ["Test"]
21 changes: 14 additions & 7 deletions src/editor/JulGameEditor/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,24 @@ repo = "https://github.com/Kyjor/JulGame.jl.git"
version = "0.1.0"

[deps]
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
SimpleDirectMediaLayer = "98e33af6-2ee5-5afd-9e75-cbc738b767c4"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
CImGui = "5d785b6c-b76f-510e-a07c-3070796c7e87"
NativeFileDialog = "e1fe445b-aa65-4df4-81c1-2041507f0fd4"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
FileWatching = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
#JulGame = "4850f9bb-d191-4a1e-9f97-ee64062927c3"
NativeFileDialog = "e1fe445b-aa65-4df4-81c1-2041507f0fd4"
SimpleDirectMediaLayer = "98e33af6-2ee5-5afd-9e75-cbc738b767c4"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
JulGame = "4850f9bb-d191-4a1e-9f97-ee64062927c3"

[compat]
CImGui = "2.0.0"
FileWatching = "1.11.0"
JSON3 = "1"
SimpleDirectMediaLayer = "0.5"
CImGui = "~2.0"
julia = "1.9"
julia = "1.9"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
using Test

ROOTDIR = joinpath(@__DIR__, "..")

@testset "All editor tests" begin
cd(joinpath(ROOTDIR, "src"))
include(joinpath(ROOTDIR, "Editor.jl"))
@testset "Editor" begin
@test Editor.run(true) == 0
end
end

# Functionalities to test in the editor module

# 1. Load a scene from the specified `scenePath` using the SceneLoaderModule.
Expand Down
3 changes: 0 additions & 3 deletions src/editor/Project.toml

This file was deleted.

12 changes: 2 additions & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,11 @@ include(joinpath(PROFILINGTESTDIR, "Platformer", "src", "Platformer.jl"))
@testset "All tests" begin
cd(joinpath(@__DIR__, "projects", "ProfilingTest", "Platformer", "src"))
@testset "Platformer" begin
@test PlatformerModule.run_platformer() == 0
# @test PlatformerModule.run_platformer() == 0
end

#include("math/mathtests.jl")
include("math/mathtests.jl")

cd(joinpath(SMOKETESTDIR, "src"))
@test SmokeTest.run(SMOKETESTDIR, Test) == 0

if !Sys.islinux()
cd(joinpath(ROOTDIR, "src", "editor", "JulGameEditor", "src"))
include(joinpath(ROOTDIR, "src", "editor", "JulGameEditor", "src", "../Editor.jl"))
@testset "Editor" begin
@test Editor.run(true) == 0
end
end
end

0 comments on commit ade2c16

Please sign in to comment.