Skip to content

armgit / gecko

Public Imported from GitHub
0

A GameCube/Wii emulator and debugger written in Rust.

updated ci workflow

Layle2a4eaf1c84a4
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index e084e3b..51d439a 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -8,6 +8,10 @@ on:
permissions:
contents: write
+env:
+ PACKAGES: -p debugger -p multitool -p gecko-app -p tinyapp -p fifoplayer
+ BINARIES: tinyapp debugger multitool gecko fifoplayer
+
jobs:
check:
runs-on: ubuntu-latest
@@ -39,18 +43,22 @@ jobs:
fail-fast: false
matrix:
include:
- - os: ubuntu-latest
+ - os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
suffix: linux-x86_64
dbg_suffix: linux-dbg-x86_64
+ - os: ubuntu-22.04-arm
+ target: aarch64-unknown-linux-gnu
+ suffix: linux-arm64
+ dbg_suffix: linux-dbg-arm64
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: windows-x86_64
dbg_suffix: windows-dbg-x86_64
- - os: macos-latest
- target: aarch64-apple-darwin
- suffix: macos-arm64
- dbg_suffix: macos-dbg-arm64
+ - os: windows-11-arm
+ target: aarch64-pc-windows-msvc
+ suffix: windows-arm64
+ dbg_suffix: windows-dbg-arm64
runs-on: ${{ matrix.os }}
@@ -62,7 +70,7 @@ jobs:
- name: Init submodules
run: git submodule update --init --depth 1 --recursive submodules/chipi-spec submodules/solstice
- - uses: dtolnay/[email protected]
+ - uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
@@ -84,7 +92,7 @@ jobs:
- name: Install mold linker
if: runner.os == 'Linux'
run: |
- sudo apt-get update && sudo apt-get install -y mold
+ sudo apt-get install -y mold
echo 'RUSTFLAGS=-C link-arg=-fuse-ld=mold' >> $GITHUB_ENV
- name: Patch Cargo.toml for CI builds
@@ -93,11 +101,11 @@ jobs:
perl -pi -e 's/^#panic = "abort"$/panic = "abort"/' Cargo.toml
perl -pi -e 's/^#codegen-units = 1$/codegen-units = 1/' Cargo.toml
- - name: Build debugger + multitool + gecko-app + tinyapp + fifoplayer (release)
- run: cargo build --release --target ${{ matrix.target }} -p debugger -p multitool -p gecko-app -p tinyapp -p fifoplayer
+ - name: Build (release)
+ run: cargo build --release --target ${{ matrix.target }} ${{ env.PACKAGES }}
- - name: Build debugger + multitool + gecko-app + tinyapp + fifoplayer (dev profile, with tracing output)
- run: cargo build --profile dev --target ${{ matrix.target }} -p debugger -p multitool -p gecko-app -p tinyapp -p fifoplayer
+ - name: Build (dev profile, with tracing output)
+ run: cargo build --profile dev --target ${{ matrix.target }} ${{ env.PACKAGES }}
- name: Package artifacts
shell: bash
@@ -110,11 +118,9 @@ jobs:
package() {
local profile=$1 suffix=$2 staging=$3
mkdir -p "$staging"
- cp "target/${{ matrix.target }}/$profile/tinyapp$EXT" "$staging/"
- cp "target/${{ matrix.target }}/$profile/debugger$EXT" "$staging/"
- cp "target/${{ matrix.target }}/$profile/multitool$EXT" "$staging/"
- cp "target/${{ matrix.target }}/$profile/gecko$EXT" "$staging/"
- cp "target/${{ matrix.target }}/$profile/fifoplayer$EXT" "$staging/"
+ for bin in $BINARIES; do
+ cp "target/${{ matrix.target }}/$profile/$bin$EXT" "$staging/"
+ done
cp LICENSE README.md "$staging/"
(cd "$staging" && 7z a "../artifacts/gecko-$suffix.zip" *)
}
@@ -127,8 +133,79 @@ jobs:
name: binaries-${{ matrix.suffix }}
path: artifacts/*
+ build-macos:
+ needs: check
+ if: needs.check.outputs.should_build == 'true'
+ runs-on: macos-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: dev
+
+ - name: Init submodules
+ run: git submodule update --init --depth 1 --recursive submodules/chipi-spec submodules/solstice
+
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: aarch64-apple-darwin, x86_64-apple-darwin
+
+ - uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ target
+ key: macos-universal-${{ hashFiles('**/Cargo.lock') }}
+ restore-keys: macos-universal-
+
+ - name: Patch Cargo.toml for CI builds
+ shell: bash
+ run: |
+ perl -pi -e 's/^#panic = "abort"$/panic = "abort"/' Cargo.toml
+ perl -pi -e 's/^#codegen-units = 1$/codegen-units = 1/' Cargo.toml
+
+ - name: Build (release, both arches)
+ run: |
+ cargo build --release --target aarch64-apple-darwin ${{ env.PACKAGES }}
+ cargo build --release --target x86_64-apple-darwin ${{ env.PACKAGES }}
+
+ - name: Build (dev profile, both arches)
+ run: |
+ cargo build --profile dev --target aarch64-apple-darwin ${{ env.PACKAGES }}
+ cargo build --profile dev --target x86_64-apple-darwin ${{ env.PACKAGES }}
+
+ - name: Lipo + package universal binaries
+ shell: bash
+ run: |
+ mkdir -p artifacts
+
+ package() {
+ local profile=$1 suffix=$2 staging=$3
+ mkdir -p "$staging"
+ for bin in $BINARIES; do
+ lipo -create \
+ "target/aarch64-apple-darwin/$profile/$bin" \
+ "target/x86_64-apple-darwin/$profile/$bin" \
+ -output "$staging/$bin"
+ done
+ cp LICENSE README.md "$staging/"
+ (cd "$staging" && 7z a "../artifacts/gecko-$suffix.zip" *)
+ }
+
+ package release macos-universal staging-rel
+ package debug macos-dbg-universal staging-dbg
+
+ - name: Verify universal binaries
+ run: lipo -info staging-rel/tinyapp
+
+ - uses: actions/upload-artifact@v4
+ with:
+ name: binaries-macos-universal
+ path: artifacts/*
+
release:
- needs: [check, build]
+ needs: [check, build, build-macos]
runs-on: ubuntu-latest
steps:
@@ -155,4 +232,4 @@ jobs:
Commit: ${{ needs.check.outputs.dev_sha }}
Built: ${{ github.run_id }}
- files: artifacts/*
+ files: artifacts/*
\ No newline at end of file
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e8960aa..dd5038a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -8,24 +8,32 @@ on:
permissions:
contents: write
+env:
+ PACKAGES: -p debugger -p multitool -p gecko-app -p tinyapp -p fifoplayer
+ BINARIES: tinyapp debugger multitool gecko fifoplayer
+
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- - os: ubuntu-latest
+ - os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
suffix: linux-x86_64
dbg_suffix: linux-dbg-x86_64
+ - os: ubuntu-22.04-arm
+ target: aarch64-unknown-linux-gnu
+ suffix: linux-arm64
+ dbg_suffix: linux-dbg-arm64
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: windows-x86_64
dbg_suffix: windows-dbg-x86_64
- - os: macos-latest
- target: aarch64-apple-darwin
- suffix: macos-arm64
- dbg_suffix: macos-dbg-arm64
+ - os: windows-11-arm
+ target: aarch64-pc-windows-msvc
+ suffix: windows-arm64
+ dbg_suffix: windows-dbg-arm64
runs-on: ${{ matrix.os }}
@@ -35,7 +43,7 @@ jobs:
- name: Init submodules
run: git submodule update --init --depth 1 --recursive submodules/chipi-spec submodules/solstice
- - uses: dtolnay/[email protected]
+ - uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
@@ -57,7 +65,7 @@ jobs:
- name: Install mold linker
if: runner.os == 'Linux'
run: |
- sudo apt-get update && sudo apt-get install -y mold
+ sudo apt-get install -y mold
echo 'RUSTFLAGS=-C link-arg=-fuse-ld=mold' >> $GITHUB_ENV
- name: Patch Cargo.toml for CI builds
@@ -66,21 +74,11 @@ jobs:
perl -pi -e 's/^#panic = "abort"$/panic = "abort"/' Cargo.toml
perl -pi -e 's/^#codegen-units = 1$/codegen-units = 1/' Cargo.toml
- - name: Build debugger + multitool + gecko-app + tinyapp + fifoplayer (release)
- run: cargo build --release --target ${{ matrix.target }} -p debugger -p multitool -p gecko-app -p tinyapp -p fifoplayer
-
- - name: Build debugger + multitool + gecko-app + tinyapp + fifoplayer (dev profile, with tracing output)
- run: cargo build --profile dev --target ${{ matrix.target }} -p debugger -p multitool -p gecko-app -p tinyapp -p fifoplayer
-
- # - name: Patch chipi dispatch strategy (tinyapp only)
- # shell: bash
- # run: perl -pi -e 's/strategy fn_ptr_lut/strategy jump_table/g' crates/gecko/spec/*.bindings.chipi
+ - name: Build (release)
+ run: cargo build --release --target ${{ matrix.target }} ${{ env.PACKAGES }}
- # - name: Build tinyapp (release)
- # run: cargo build --release --package tinyapp --target ${{ matrix.target }}
-
- # - name: Build tinyapp (dev profile, with tracing output)
- # run: cargo build --profile dev --package tinyapp --target ${{ matrix.target }}
+ - name: Build (dev profile, with tracing output)
+ run: cargo build --profile dev --target ${{ matrix.target }} ${{ env.PACKAGES }}
- name: Package artifacts
shell: bash
@@ -93,11 +91,9 @@ jobs:
package() {
local profile=$1 suffix=$2 staging=$3
mkdir -p "$staging"
- cp "target/${{ matrix.target }}/$profile/tinyapp$EXT" "$staging/"
- cp "target/${{ matrix.target }}/$profile/debugger$EXT" "$staging/"
- cp "target/${{ matrix.target }}/$profile/multitool$EXT" "$staging/"
- cp "target/${{ matrix.target }}/$profile/gecko$EXT" "$staging/"
- cp "target/${{ matrix.target }}/$profile/fifoplayer$EXT" "$staging/"
+ for bin in $BINARIES; do
+ cp "target/${{ matrix.target }}/$profile/$bin$EXT" "$staging/"
+ done
cp LICENSE README.md "$staging/"
(cd "$staging" && 7z a "../artifacts/gecko-$suffix.zip" *)
}
@@ -110,8 +106,75 @@ jobs:
name: binaries-${{ matrix.suffix }}
path: artifacts/*
+ build-macos:
+ runs-on: macos-latest
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Init submodules
+ run: git submodule update --init --depth 1 --recursive submodules/chipi-spec submodules/solstice
+
+ - uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: aarch64-apple-darwin, x86_64-apple-darwin
+
+ - uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cargo/registry
+ ~/.cargo/git
+ target
+ key: macos-universal-${{ hashFiles('**/Cargo.lock') }}
+ restore-keys: macos-universal-
+
+ - name: Patch Cargo.toml for CI builds
+ shell: bash
+ run: |
+ perl -pi -e 's/^#panic = "abort"$/panic = "abort"/' Cargo.toml
+ perl -pi -e 's/^#codegen-units = 1$/codegen-units = 1/' Cargo.toml
+
+ - name: Build (release, both arches)
+ run: |
+ cargo build --release --target aarch64-apple-darwin ${{ env.PACKAGES }}
+ cargo build --release --target x86_64-apple-darwin ${{ env.PACKAGES }}
+
+ - name: Build (dev profile, both arches)
+ run: |
+ cargo build --profile dev --target aarch64-apple-darwin ${{ env.PACKAGES }}
+ cargo build --profile dev --target x86_64-apple-darwin ${{ env.PACKAGES }}
+
+ - name: Lipo + package universal binaries
+ shell: bash
+ run: |
+ mkdir -p artifacts
+
+ package() {
+ local profile=$1 suffix=$2 staging=$3
+ mkdir -p "$staging"
+ for bin in $BINARIES; do
+ lipo -create \
+ "target/aarch64-apple-darwin/$profile/$bin" \
+ "target/x86_64-apple-darwin/$profile/$bin" \
+ -output "$staging/$bin"
+ done
+ cp LICENSE README.md "$staging/"
+ (cd "$staging" && 7z a "../artifacts/gecko-$suffix.zip" *)
+ }
+
+ package release macos-universal staging-rel
+ package debug macos-dbg-universal staging-dbg
+
+ - name: Verify universal binaries
+ run: lipo -info staging-rel/tinyapp
+
+ - uses: actions/upload-artifact@v4
+ with:
+ name: binaries-macos-universal
+ path: artifacts/*
+
release:
- needs: build
+ needs: [build, build-macos]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
@@ -134,4 +197,4 @@ jobs:
target_commitish: ${{ github.sha }}
name: Release (master)
generate_release_notes: true
- files: artifacts/*
+ files: artifacts/*
\ No newline at end of file