Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools refactoring #238

Merged
merged 23 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4bee5ef
Rewrite pdtool (#231)
boozook Mar 30, 2024
5519ee1
fix ctrl const: remove `#[const_trait]`
boozook Mar 31, 2024
e8e434c
Merge pull request #232 from boozook/api/fix-ctrl-const
boozook Mar 31, 2024
e536a57
fix readme, add cargo-playdate to CI dev builds
boozook Mar 31, 2024
128b9fa
Report success if SDK has been found
eirnym Mar 31, 2024
4ad69a5
Merge pull request #234 from eirnym/sdk-search-success
boozook Apr 1, 2024
d8429a1
various small improvements
boozook Apr 1, 2024
4a7a1e6
hot-fix for "missed cargo products", `PackageId` format breaking chan…
boozook Apr 1, 2024
16ebf30
add third format support (with missed crate name) for
boozook Apr 1, 2024
333abf4
bump `cargo-playdate` version
boozook Apr 1, 2024
bd6f4bf
Merge branch 'main' into dev/refactoring/tools
boozook Apr 1, 2024
040782d
CI: install linux deps for tools
boozook Apr 1, 2024
c2a0b09
change `cargo-playdate` version
boozook Apr 1, 2024
8295555
CI: tests on gh- aarm64 mac
boozook Apr 1, 2024
597dc0c
Use XDG paths to search for Playdate SDK
eirnym Apr 1, 2024
1180661
CI: more tests on gh- aarm64
boozook Apr 1, 2024
aaf30a9
Merge pull request #240 from eirnym/xdg-config-search
boozook Apr 1, 2024
ac9075f
bump build-utils and bindgen,
boozook Apr 1, 2024
e2af8af
CI: enable build-utils tests on windows
boozook Apr 1, 2024
5ca6f05
Remove windows deps that previously was, but unnecessary now
boozook Apr 1, 2024
85ebd13
Check Windows registry for SDK path
eirnym Apr 1, 2024
a9aad8c
CI: disable tests on codemagic-CI because aarch64 existing on GH.
boozook Apr 1, 2024
c5977be
Merge pull request #241 from eirnym/registry-windows
boozook Apr 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Dev
on:
workflow_dispatch:
inputs:
source:
description: "Source ref used to build bindings. Uses `github.ref`` by default."
required: false
sha:
description: "Source SHA used to build bindings. Uses `github.sha`` by default."
required: false
push:
branches: [dev/**, refactor/**]

env:
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
CARGO_TERM_COLOR: always
CARGO_TERM_PROGRESS_WHEN: never
CARGO_INCREMENTAL: 1
# logging:
RUST_LOG: trace
CARGO_PLAYDATE_LOG: trace

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-14
# - macos-latest
- ubuntu-latest
- windows-latest
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.source || github.ref || github.event.ref }}

- name: Cache
uses: actions/[email protected]
with:
path: |
target/
~/.cargo
key: ${{ runner.os }}-dev-build-${{ hashFiles('Cargo.lock') }}

- name: Config
run: |
mkdir -p .cargo
cp -rf .github/config.toml .cargo/config.toml

- name: Cache LLVM
id: cache-llvm
if: runner.os == 'Windows'
uses: actions/[email protected]
with:
path: ${{ runner.temp }}/llvm
key: llvm-14.0

# See:
# https://github.com/rust-lang/rust-bindgen/issues/1797
# https://rust-lang.github.io/rust-bindgen/requirements.html#windows
- name: Install LLVM
if: runner.os == 'Windows'
uses: KyleMayes/[email protected]
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
env: true


- name: Install linux deps
if: runner.os == 'Linux'
run: |
sudo apt install pkg-config -y
sudo apt install libudev-dev -y


- name: cargo
continue-on-error: true
run: cargo build --bin=cargo-playdate
- name: Upload
uses: actions/upload-artifact@v4
with:
name: cargo-playdate-${{ runner.os }}-${{ runner.arch }}${{ ((runner.os == 'Windows') && '.exe') || ' ' }}
path: target/debug/cargo-playdate${{ ((runner.os == 'Windows') && '.exe') || ' ' }}
if-no-files-found: warn
retention-days: 3
overwrite: true


- name: pdtool
continue-on-error: true
run: cargo build -p=playdate-tool --bin=pdtool

- name: Upload
id: upload
uses: actions/upload-artifact@v4
with:
name: pdtool-${{ runner.os }}-${{ runner.arch }}${{ ((runner.os == 'Windows') && '.exe') || ' ' }}
path: target/debug/pdtool${{ ((runner.os == 'Windows') && '.exe') || ' ' }}
if-no-files-found: warn
retention-days: 3
overwrite: true
- name: Artifact
run: |
echo 'ID: ${{ steps.upload.outputs.artifact-id }}'
echo 'URL: ${{ steps.upload.outputs.artifact-url }}'

- name: pdtool with tracing
continue-on-error: true
run: cargo build -p=playdate-tool --bin=pdtool --features=tracing

- name: Upload
uses: actions/upload-artifact@v4
with:
name: pdtool+tracing-${{ runner.os }}-${{ runner.arch }}${{ ((runner.os == 'Windows') && '.exe') || ' ' }}
path: target/debug/pdtool${{ ((runner.os == 'Windows') && '.exe') || ' ' }}
if-no-files-found: warn
retention-days: 3
overwrite: true
- name: Artifact
run: |
echo 'ID: ${{ steps.upload.outputs.artifact-id }}'
echo 'URL: ${{ steps.upload.outputs.artifact-url }}'

outputs:
artifact-id: ${{ steps.upload.outputs.artifact-id }}
artifact-url: ${{ steps.upload.outputs.artifact-url }}
68 changes: 50 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ jobs:
fail-fast: false
matrix:
os:
- macos-latest
- macos-14
# - macos-latest
- ubuntu-latest
# - windows-latest
sdk:
Expand All @@ -55,6 +56,7 @@ jobs:
- 2.4.0

steps:
- run: arch
- uses: actions/checkout@v4

- name: Cache
Expand All @@ -63,7 +65,7 @@ jobs:
path: |
target/
~/.cargo
key: ${{ runner.os }}-cargo-tests-${{ hashFiles('Cargo.lock') }}
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: Config
run: |
Expand Down Expand Up @@ -97,6 +99,14 @@ jobs:
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: Install linux deps
if: runner.os == 'Linux'
run: |
sudo apt install pkg-config -y
sudo apt install libudev-dev -y


- name: SDK ${{ steps.sdk.outputs.version }} installed
run: which pdc && pdc --version

Expand Down Expand Up @@ -164,9 +174,10 @@ jobs:
fail-fast: false
matrix:
os:
- macos-latest
- macos-14
# - macos-latest
- ubuntu-latest
# - windows-latest
- windows-latest
sdk:
- latest

Expand All @@ -179,27 +190,33 @@ jobs:
path: |
target/
~/.cargo
key: ${{ runner.os }}-cargo-tests-${{ hashFiles('Cargo.lock') }}
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ 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 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: Install linux deps
if: runner.os == 'Linux'
run: |
sudo apt install pkg-config -y
sudo apt install libudev-dev -y

- name: SDK ${{ steps.sdk.outputs.version }} installed
run: which pdc && pdc --version

Expand All @@ -220,7 +237,8 @@ jobs:
fail-fast: false
matrix:
os:
- macos-latest
- macos-14
# - macos-latest
- ubuntu-latest
# - windows-latest
sdk:
Expand All @@ -237,7 +255,7 @@ jobs:
path: |
target/
~/.cargo
key: ${{ runner.os }}-cargo-tests-${{ hashFiles('Cargo.lock') }}
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: Config
run: |
Expand Down Expand Up @@ -272,6 +290,12 @@ jobs:
pkg-config --cflags --libs libusb-1.0
pkg-config --cflags --libs libusb

- name: Install linux deps
if: runner.os == 'Linux'
run: |
sudo apt install pkg-config -y
sudo apt install libudev-dev -y

- name: Install Playdate SDK ${{ matrix.sdk }}
id: sdk
uses: pd-rs/get-playdate-sdk@main
Expand Down Expand Up @@ -318,7 +342,8 @@ jobs:
fail-fast: false
matrix:
os:
- macos-latest
- macos-14
# - macos-latest
- ubuntu-latest
# - windows-latest
sdk:
Expand All @@ -334,10 +359,10 @@ jobs:
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-tests-examples-${{ hashFiles('Cargo.lock') }}
key: ${{ runner.os }}-${{ runner.arch }}-cargo-examples-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-tests-examples-${{ hashFiles('Cargo.lock') }}
${{ runner.os }}-cargo-tests-${{ hashFiles('Cargo.lock') }}
${{ runner.os }}-${{ runner.arch }}-cargo-examples-${{ hashFiles('Cargo.lock') }}
${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('Cargo.lock') }}

- name: Config
run: |
Expand Down Expand Up @@ -374,6 +399,13 @@ jobs:
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: Install linux deps
if: runner.os == 'Linux'
run: |
sudo apt install pkg-config -y
sudo apt install libudev-dev -y


- name: SDK ${{ steps.sdk.outputs.version }} installed
run: which pdc && pdc --version

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ jobs:
fail-fast: true
matrix:
os:
- macos-latest
- macos-14
# - macos-latest
- ubuntu-latest
# - windows-latest
sdk:
Expand Down
Loading
Loading