Skip to content

Commit

Permalink
ci: separate nimble task for debug and release example builds
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Arndt <[email protected]>
  • Loading branch information
SpotlightKid committed Oct 13, 2024
1 parent 5a85b3a commit 8bc3d90
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Github Actions
name: Run tests and build examples
on: [push, pull_request]
jobs:
build:
Expand Down Expand Up @@ -31,6 +31,6 @@ jobs:
- name: Run tests
run: nimble test -y
- name: Build examples (debug)
run: nimble examples
run: nimble examples_debug
- name: Build examples (release)
run: nimble examples -d:release
run: nimble examples
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: docs
name: Build and publish API docs
on:
push:
branches:
Expand Down
17 changes: 14 additions & 3 deletions sndfile.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ requires "nim >= 2.0"

taskrequires "examples", "sdl2"

task examples, "Build examples":
selfExec("compile examples/playfile_sdl.nim")
selfExec("compile examples/list_formats.nim")
let examples = @[
"list_formats",
"playfile_sdl",
]

task examples, "Build examples (release)":
for example in examples:
echo "Building example '" & example & "'..."
selfExec("compile -d:release -d:strip examples/" & example & ".nim")

task examples_debug, "Build examples (debug)":
for example in examples:
echo "Building example '" & example & "'..."
selfExec("compile examples/" & example & ".nim")

0 comments on commit 8bc3d90

Please sign in to comment.