-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from boozook/api/sprite
Add sprite API
- Loading branch information
Showing
26 changed files
with
3,350 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ jobs: | |
- uses: actions/labeler@v4 | ||
with: | ||
dot: false | ||
sync-labels: true | ||
sync-labels: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,18 @@ env: | |
# logging: | ||
RUST_LOG: trace | ||
CARGO_PLAYDATE_LOG: trace | ||
# crates lists: | ||
API_CRATES: >- | ||
-p=playdate-sys | ||
-p=playdate-fs | ||
-p=playdate-sound | ||
-p=playdate-color | ||
-p=playdate-controls | ||
-p=playdate-menu | ||
-p=playdate-graphics | ||
-p=playdate-display | ||
-p=playdate-system | ||
-p=playdate-sprite | ||
jobs: | ||
api: | ||
|
@@ -50,7 +62,7 @@ jobs: | |
- name: Cache LLVM | ||
id: cache-llvm | ||
if: matrix.os == 'windows-latest' | ||
if: runner.os == 'Windows' | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ runner.temp }}/llvm | ||
|
@@ -60,7 +72,7 @@ jobs: | |
# https://github.com/rust-lang/rust-bindgen/issues/1797 | ||
# https://rust-lang.github.io/rust-bindgen/requirements.html#windows | ||
- name: Install LLVM | ||
if: matrix.os == 'windows-latest' | ||
if: runner.os == 'Windows' | ||
uses: KyleMayes/[email protected] | ||
with: | ||
version: "14.0" | ||
|
@@ -85,34 +97,19 @@ jobs: | |
cargo test -p=playdate-sys --features=$FEATURES_1 -- --nocapture | ||
cargo test -p=playdate-sys --features=$FEATURES_2 -- --nocapture | ||
cargo test -p=playdate-fs --lib --no-default-features --features=$FEATURES_1 -- --nocapture | ||
cargo test -p=playdate-fs --lib --no-default-features --features=$FEATURES_2 -- --nocapture | ||
cargo test ${{ env.API_CRATES }} --lib --no-default-features --features=$FEATURES_1 -- --nocapture | ||
cargo test ${{ env.API_CRATES }} --lib --no-default-features --features=$FEATURES_2 -- --nocapture | ||
cargo test -p=playdate-sound --lib --no-default-features --features=$FEATURES_1 -- --nocapture | ||
cargo test -p=playdate-sound --lib --no-default-features --features=$FEATURES_2 -- --nocapture | ||
cargo test -p=playdate-color --lib --no-default-features --features=$FEATURES_1 -- --nocapture | ||
cargo test -p=playdate-color --lib --no-default-features --features=$FEATURES_2 -- --nocapture | ||
cargo test -p=playdate-controls --lib --no-default-features --features=$FEATURES_1 -- --nocapture | ||
cargo test -p=playdate-controls --lib --no-default-features --features=$FEATURES_2 -- --nocapture | ||
cargo test -p=playdate-menu --lib --no-default-features --features=$FEATURES_1 -- --nocapture | ||
cargo test -p=playdate-menu --lib --no-default-features --features=$FEATURES_2 -- --nocapture | ||
cargo test -p=playdate-graphics --lib --no-default-features --features=$FEATURES_1 -- --nocapture | ||
cargo test -p=playdate-graphics --lib --no-default-features --features=$FEATURES_2 -- --nocapture | ||
cargo test -p=playdate-display --lib --no-default-features --features=$FEATURES_1 -- --nocapture | ||
cargo test -p=playdate-display --lib --no-default-features --features=$FEATURES_2 -- --nocapture | ||
cargo test -p=playdate-system --lib --no-default-features --features=$FEATURES_1 -- --nocapture | ||
cargo test -p=playdate-system --lib --no-default-features --features=$FEATURES_2 -- --nocapture | ||
- name: Check device target | ||
run: | | ||
# should we check with -Zbuild-std ? | ||
cargo check ${{ env.API_CRATES }} --target=thumbv7em-none-eabihf | ||
- name: Examples | ||
run: | | ||
FEATURES=bindgen-runtime,bindings-derive-debug | ||
# TODO: use ${{ env.API_CRATES }} when all crates will have example | ||
cargo build --target=thumbv7em-none-eabihf -p=playdate-fs --examples --features=$FEATURES -Zbuild-std | ||
cargo build --target=thumbv7em-none-eabihf -p=playdate-controls --examples --features=$FEATURES -Zbuild-std | ||
cargo build --target=thumbv7em-none-eabihf -p=playdate-color --examples --features=$FEATURES -Zbuild-std | ||
|
@@ -129,8 +126,64 @@ jobs: | |
run: | | ||
cargo doc -p=playdate-sys -v --target=thumbv7em-none-eabihf --features=bindings-documentation,bindings-derive-default,bindings-derive-eq,bindings-derive-copy,bindings-derive-debug,bindings-derive-hash,bindings-derive-ord,bindings-derive-partialeq,bindings-derive-partialord | ||
tools: | ||
name: Tools | ||
utils: | ||
name: Utils | ||
defaults: | ||
run: | ||
shell: bash | ||
needs: format | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- macos-latest | ||
- ubuntu-latest | ||
# - windows-latest | ||
sdk: | ||
- latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
target/ | ||
~/.cargo | ||
key: ${{ runner.os }}-cargo-tests-${{ hashFiles('Cargo.lock') }} | ||
|
||
- name: Config | ||
run: | | ||
mkdir -p .cargo | ||
cp -rf .github/config.toml .cargo/config.toml | ||
- name: Install Deps | ||
if: runner.os == 'Windows' | ||
run: | | ||
# mingw-w64-x86_64-libusb | ||
choco install pkgconfiglite | ||
pkg-config --cflags --libs libusb-1.0 | ||
pkg-config --cflags --libs libusb | ||
- name: Install Playdate SDK ${{ matrix.sdk }} | ||
id: sdk | ||
uses: pd-rs/get-playdate-sdk@main | ||
with: | ||
version: ${{ matrix.sdk }} | ||
|
||
- name: SDK ${{ steps.sdk.outputs.version }} installed | ||
run: which pdc && pdc --version | ||
|
||
- name: Test | ||
run: | | ||
cargo test -p=playdate-build-utils --all-features | ||
cargo test -p=playdate-build --all-features | ||
cargo test -p=playdate-tool --all-features | ||
tool: | ||
name: Tool | ||
defaults: | ||
run: | ||
shell: bash | ||
|
@@ -164,7 +217,7 @@ jobs: | |
- name: Cache LLVM | ||
id: cache-llvm | ||
if: matrix.os == 'windows-latest' | ||
if: runner.os == 'Windows' | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ runner.temp }}/llvm | ||
|
@@ -174,7 +227,7 @@ jobs: | |
# https://github.com/rust-lang/rust-bindgen/issues/1797 | ||
# https://rust-lang.github.io/rust-bindgen/requirements.html#windows | ||
- name: Install LLVM | ||
if: matrix.os == 'windows-latest' | ||
if: runner.os == 'Windows' | ||
uses: KyleMayes/[email protected] | ||
with: | ||
version: "14.0" | ||
|
@@ -183,7 +236,7 @@ jobs: | |
env: true | ||
|
||
- name: Install Deps | ||
if: matrix.os == 'windows-latest' | ||
if: runner.os == 'Windows' | ||
run: | | ||
# mingw-w64-x86_64-libusb | ||
choco install pkgconfiglite | ||
|
@@ -202,15 +255,9 @@ jobs: | |
- name: Check | ||
run: cargo check --tests -p=cargo-playdate --all-features | ||
|
||
- name: Test Utils | ||
run: | | ||
cargo test -p=playdate-build-utils --all-features | ||
cargo test -p=playdate-build --all-features | ||
cargo test -p=playdate-tool --all-features | ||
# Simulator doesn't works in headless mode | ||
# - name: Install Sim Deps | ||
# if: ${{ matrix.os == 'ubuntu-latest' }} | ||
# if: ${{ runner.os == 'Linux' }} | ||
# run: | | ||
# sudo apt update | ||
# sudo apt -y install libwebkit2gtk-4.0-dev | ||
|
@@ -220,6 +267,15 @@ jobs: | |
cargo test -p=cargo-playdate -- --nocapture | ||
rm -rf ./target/tmp | ||
- name: Execution | ||
if: runner.os == 'macOS' | ||
continue-on-error: true # this is flickering on CI 🤷🏻♂️ | ||
env: | ||
RUSTFLAGS: --cfg exec_tests | ||
run: | | ||
cargo test -p=cargo-playdate run -- --nocapture --test-threads=1 | ||
rm -rf ./target/tmp | ||
use-tool: | ||
name: Examples | ||
defaults: | ||
|
@@ -245,18 +301,22 @@ jobs: | |
with: | ||
path: | | ||
~/.cargo | ||
key: ${{ runner.os }}-cargo-tests-${{ hashFiles('Cargo.lock') }} | ||
key: ${{ runner.os }}-cargo-tests-examples-${{ hashFiles('Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-tests-examples-${{ hashFiles('Cargo.lock') }} | ||
${{ runner.os }}-cargo-tests-${{ hashFiles('Cargo.lock') }} | ||
- name: Config | ||
run: | | ||
rm -rf ./target/tmp || true | ||
rm -rf ./target/playdate || true | ||
mkdir -p .cargo | ||
cp -rf .github/config.toml .cargo/config.toml | ||
cargo clean | ||
- name: Cache LLVM | ||
id: cache-llvm | ||
if: matrix.os == 'windows-latest' | ||
if: runner.os == 'Windows' | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ runner.temp }}/llvm | ||
|
@@ -266,7 +326,7 @@ jobs: | |
# https://github.com/rust-lang/rust-bindgen/issues/1797 | ||
# https://rust-lang.github.io/rust-bindgen/requirements.html#windows | ||
- name: Install LLVM | ||
if: matrix.os == 'windows-latest' | ||
if: runner.os == 'Windows' | ||
uses: KyleMayes/[email protected] | ||
with: | ||
version: "14.0" | ||
|
@@ -290,6 +350,7 @@ jobs: | |
run: | | ||
FEATURES=bindgen-runtime,bindings-derive-debug | ||
# TODO: use ${{ env.API_CRATES }} when all crates will have example | ||
cargo playdate package --simulator --device -p=playdate-sys --examples --features=$FEATURES | ||
cargo playdate package --simulator --device -p=playdate-fs --examples --features=$FEATURES | ||
cargo playdate package --simulator --device -p=playdate-controls --examples --features=$FEATURES | ||
|
Oops, something went wrong.