Sys build improvements #7
Workflow file for this run
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
name: Tests | |
on: | |
workflow_call: | |
inputs: | |
ref: | |
description: git branch, tag or SHA to checkout. | |
type: string | |
required: true | |
pull_request: | |
push: | |
branches: [main, master] | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_RETRY: 10 | |
RUSTUP_MAX_RETRIES: 10 | |
CARGO_TERM_COLOR: always | |
CARGO_TERM_PROGRESS_WHEN: never | |
# logging: | |
RUST_LOG: trace | |
CARGO_PLAYDATE_LOG: trace | |
# crates lists: | |
API_CRATES: >- | |
-p=playdate-color | |
-p=playdate-controls | |
-p=playdate-display | |
-p=playdate-fs | |
-p=playdate-graphics | |
-p=playdate-menu | |
-p=playdate-scoreboards | |
-p=playdate-sound | |
-p=playdate-sprite | |
-p=playdate-system | |
-p=playdate | |
PD_BUILD_BINDINGS_ONCE: 1 | |
jobs: | |
sys: | |
name: Sys | |
env: | |
FEATURES_1: bindgen-runtime | |
FEATURES_2: bindgen-runtime,bindings-derive-debug | |
FEATURES_3: bindgen-runtime,bindings-derive-debug,sys/bindings-documentation,sys/error-ctx | |
BUILD_STD_ARGS: -Zbuild-std=core,alloc --target=thumbv7em-none-eabihf | |
defaults: | |
run: | |
shell: bash | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macos-14 | |
- ubuntu-latest | |
- windows-latest | |
sdk: | |
- latest | |
# - 2.6.2 | |
# - beta | |
bindgen: | |
- install: false | |
- install: false | |
features: bindings-derive-debug | |
- install: false | |
features: bindgen-runtime | |
- install: false | |
features: bindgen-runtime,bindings-derive-debug | |
- install: true | |
- install: true | |
features: bindings-derive-debug | |
- install: true | |
features: bindgen-runtime | |
- install: true | |
features: bindgen-runtime,bindings-derive-debug | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
# - name: Cache | |
# uses: actions/cache@v4 | |
# with: | |
# path: | | |
# ~/.cargo | |
# # key: api-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('api/**/Cargo.toml') }} | |
# key: api-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('api/sys/Cargo.toml') }} | |
- name: Config | |
uses: ./.github/actions/init-cfg | |
# - name: Install Deps | |
# if: matrix.bindgen.install | |
# uses: ./.github/actions/tools-deps | |
- name: Install bindgen | |
if: matrix.bindgen.install | |
uses: ./.github/actions/install-bindgen | |
- name: Installed playdate-bindgen | |
if: matrix.bindgen.install | |
run: pdbindgen -V | |
# - name: Install Playdate SDK ${{ matrix.sdk }} | |
# id: sdk | |
# uses: pd-rs/get-playdate-sdk@main | |
# with: | |
# version: ${{ matrix.sdk }} | |
# custom-url: ${{ matrix.sdk == 'beta' && ((runner.os == 'macOS' && secrets.SDK_BETA_MACOS) || (runner.os == 'Linux' && secrets.SDK_BETA_LINUX) || (runner.os == 'Windows' && secrets.SDK_BETA_WINDOWS)) || '' }} | |
# - name: SDK ${{ steps.sdk.outputs.version }} installed | |
# run: which pdc && pdc --version | |
# - name: Install Bindgen | |
# # id: pdbindgen | |
# # continue-on-error: true | |
# if: runner.os == 'Windows' | |
# env: | |
# # LLVM_CONFIG_PATH: ${{ env.LLVM_PATH }}\\bin\\llvm-config | |
# LIBCLANG_PATH: ${{ env.LLVM_PATH }}\\bin | |
# run: >- | |
# cargo install playdate-bindgen --path ./support/bindgen | |
# --features=cli | |
# --debug | |
# # --features=cli,static --no-default-features | |
# - name: Test Sys (host) | |
# run: | | |
# cargo test -p=playdate-sys --features=lang-items -- --nocapture | |
# cargo test -p=playdate-sys --features=lang-items,$FEATURES_1 | |
# cargo test -p=playdate-sys --features=lang-items,$FEATURES_2 | |
# - name: Build Sys (device) | |
# # env: | |
# ## add env if step.pdbindgen.failed | |
# # DOCS_RS: ${{ runner.os == 'Windows' && 1 || 0 }} | |
# # IGNORE_EXISTING_PLAYDATE_SDK: ${{ runner.os == 'Windows' && 1 || 0 }} | |
# run: | | |
# cargo build -p=playdate-sys ${{ env.BUILD_STD_ARGS }} | |
# cargo build -p=playdate-sys --features=lang-items,$FEATURES_1 ${{ env.BUILD_STD_ARGS }} --examples | |
# cargo build -p=playdate-sys --features=lang-items,$FEATURES_2 ${{ env.BUILD_STD_ARGS }} --examples | |
# - name: Test Crates (host) | |
# run: | | |
# 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 | |
# # cargo test ${{ env.API_CRATES }} --lib --no-default-features --features=$FEATURES_3 | |
# - name: Check Crates (device) | |
# run: cargo check ${{ env.API_CRATES }} --target=thumbv7em-none-eabihf | |
# - name: Build Crates (device) | |
# run: | | |
# cargo build ${{ env.API_CRATES }} --features=sys/lang-items,$FEATURES_1 ${{ env.BUILD_STD_ARGS }} --examples --lib | |
# cargo build ${{ env.API_CRATES }} --features=sys/lang-items,$FEATURES_2 ${{ env.BUILD_STD_ARGS }} --examples --lib | |
# cargo build ${{ env.API_CRATES }} --features=sys/lang-items,$FEATURES_3 ${{ env.BUILD_STD_ARGS }} --examples --lib | |
api-docs: | |
name: API (docs.rs) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.ref || github.ref }} | |
- name: Config | |
run: | | |
mkdir -p .cargo | |
cp -rf .github/config.toml .cargo/config.toml | |
# Imitate docs.rs environment | |
- name: Test in no-sdk environment | |
env: | |
DOCS_RS: 1 | |
PLAYDATE_SDK_PATH: 0 | |
IGNORE_EXISTING_PLAYDATE_SDK: 1 | |
run: | | |
cargo doc -p=playdate-sys --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 |