mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Migrate build-example-gba-files to just
This commit is contained in:
parent
c12b8d60ef
commit
432ea71966
35
.github/scripts/build-example-gba-files.sh
vendored
35
.github/scripts/build-example-gba-files.sh
vendored
|
@ -1,35 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e # Fail if any command fails
|
||||
set -x # print every command before it runs
|
||||
|
||||
# Requires gbafix and arm-none-eabi-objcopy to already be installed
|
||||
|
||||
function build_rom() {
|
||||
local GAME_FOLDER="$1"
|
||||
local INTERNAL_NAME="$2"
|
||||
|
||||
local GAME_NAME
|
||||
GAME_NAME="$(basename "$GAME_FOLDER")"
|
||||
|
||||
local TARGET_FOLDER="${CARGO_TARGET_DIR:-$GAME_FOLDER/target}"
|
||||
local GBA_FILE="$TARGET_FOLDER/$GAME_NAME.gba"
|
||||
|
||||
(cd "$GAME_FOLDER" && cargo build --release --verbose --target thumbv4t-none-eabi)
|
||||
|
||||
mkdir -p examples/target/examples
|
||||
|
||||
arm-none-eabi-objcopy -O binary "$TARGET_FOLDER/thumbv4t-none-eabi/release/$GAME_NAME" "$GBA_FILE"
|
||||
gbafix -p "-t${INTERNAL_NAME:0:12}" "-c${INTERNAL_NAME:0:4}" -mGC "$GBA_FILE"
|
||||
|
||||
cp -v "$GBA_FILE" "examples/target/examples/$GAME_NAME.gba"
|
||||
}
|
||||
|
||||
mkdir -p examples/target
|
||||
|
||||
build_rom "examples/the-purple-night" "PURPLENIGHT"
|
||||
build_rom "examples/the-hat-chooses-the-wizard" "HATWIZARD"
|
||||
|
||||
build_rom "book/games/pong" "PONG"
|
||||
|
||||
(cd examples/target && zip examples.zip examples/*.gba)
|
23
.github/scripts/run-branch-build.sh
vendored
23
.github/scripts/run-branch-build.sh
vendored
|
@ -1,23 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e # Fail if any command fails
|
||||
|
||||
CARGO_PROJECT_FILES=( agb-*/Cargo.toml agb/Cargo.toml examples/*/Cargo.toml book/games/*/Cargo.toml )
|
||||
|
||||
for CARGO_PROJECT_FILE in "${CARGO_PROJECT_FILES[@]}"; do
|
||||
PROJECT_DIR=$(dirname "$CARGO_PROJECT_FILE")
|
||||
|
||||
echo "Checking project $PROJECT_DIR"
|
||||
(cd "$PROJECT_DIR" && cargo build)
|
||||
|
||||
if echo "$PROJECT_DIR" | grep -qE '^agb'; then
|
||||
echo "Running clippy on $PROJECT_DIR"
|
||||
(cd "$PROJECT_DIR" && cargo clippy)
|
||||
|
||||
echo "Testing $PROJECT_DIR in debug mode"
|
||||
(cd "$PROJECT_DIR" && cargo test)
|
||||
|
||||
echo "Testing $PROJECT_DIR in release mode"
|
||||
(cd "$PROJECT_DIR" && cargo test --release)
|
||||
fi
|
||||
done
|
5
.github/workflows/build-and-test.yml
vendored
5
.github/workflows/build-and-test.yml
vendored
|
@ -32,7 +32,6 @@ jobs:
|
|||
run: echo "CARGO_TARGET_DIR=$HOME/target" >> $GITHUB_ENV
|
||||
- name: Install gbafix
|
||||
run: cargo install gbafix
|
||||
- uses: extractions/setup-just@v1
|
||||
- name: Build and test all crates
|
||||
run: bash .github/scripts/run-branch-build.sh
|
||||
- name: Build example projects
|
||||
run: bash .github/scripts/build-example-gba-files.sh
|
||||
run: just ci
|
Loading…
Reference in a new issue