Skip to content

Commit

Permalink
Nim 2 support
Browse files Browse the repository at this point in the history
Fixes samdze#17
  • Loading branch information
Nycto committed Mar 26, 2024
1 parent 8af9f18 commit 15b0bec
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/actions/build-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Common build setup
inputs:
headless-simulator-support:
required: true
nim-version:
required: true
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -37,7 +39,7 @@ runs:
- name: Install Nim
uses: jiro4989/setup-nim-action@v1
with:
nim-version: '1.6.16'
nim-version: ${{ inputs.nim-version }}

# Some of the apt dependencies require input from the installer. This disables those
# prompts so we can do a headless install
Expand Down Expand Up @@ -87,4 +89,5 @@ runs:

- name: Locally publish playdate nimble package
shell: bash
run: nimble develop
if: ${{ startsWith(inputs.nim-version, '1.') }}
run: nimble develop
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ jobs:
strategy:
matrix:
target: [ device, simulator ]
nim-version: [ 1.6.16, 2.0.2 ]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-setup
with:
headless-simulator-support: false
nim-version: ${{ matrix.nim-version }}
- uses: ./.github/actions/project-setup
with:
working-directory: ./playdate_example
Expand All @@ -22,24 +24,32 @@ jobs:
tests:
runs-on: ubuntu-latest
container: node:20
strategy:
matrix:
nim-version: [ 1.6.16, 2.0.2 ]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-setup
with:
headless-simulator-support: false
nim-version: ${{ matrix.nim-version }}
- run: nimble test

headless-tests:
runs-on: ubuntu-latest
timeout-minutes: 5
container: node:20
strategy:
matrix:
nim-version: [ 1.6.16, 2.0.2 ]
steps:

- uses: actions/checkout@v3

- uses: ./.github/actions/build-setup
with:
headless-simulator-support: true
nim-version: ${{ matrix.nim-version }}

- uses: ./.github/actions/project-setup
with:
Expand All @@ -50,4 +60,6 @@ jobs:

- name: Run headless test
working-directory: ./tests
run: xvfb-run "$PLAYDATE_SDK_PATH/bin/PlaydateSimulator" tests.pdx
run: |
export HOME="/config"
xvfb-run "$PLAYDATE_SDK_PATH/bin/PlaydateSimulator" tests.pdx
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This package is an independent bindings library, not affiliated with Panic.
### Prerequisites

- Playdate SDK
- Nim 1.6.10+ (check with `nim -v`, untested with 2.0+) ([recommended extension for VSCode](https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode))
- Nim 1.6.10+ or Nim 2+ ([recommended extension for VSCode](https://marketplace.visualstudio.com/items?itemName=nimsaem.nimvscode))
- Nimble 0.13.1 (check with `nimble -v`)
- `PLAYDATE_SDK_PATH` environment variable
- [SDK Prerequisites](https://sdk.play.date/Inside%20Playdate%20with%20C.html#_prerequisites) based on OS, and [MinGW on Windows](https://code.visualstudio.com/docs/cpp/config-mingw).
Expand Down
7 changes: 7 additions & 0 deletions playdate_example/nimble.develop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": 1,
"includes": [],
"dependencies": [
".."
]
}
7 changes: 7 additions & 0 deletions tests/nimble.develop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": 1,
"includes": [],
"dependencies": [
".."
]
}

0 comments on commit 15b0bec

Please sign in to comment.