-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build and upload examples on push and when bindings are updated
- Loading branch information
Showing
3 changed files
with
127 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Build example | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
install-vitasdk: | ||
uses: ./.github/workflows/setup-vitasdk.yml | ||
with: | ||
path: /opt/vitasdk | ||
|
||
build-example: | ||
name: Build example | ||
runs-on: ubuntu-latest | ||
needs: install-vitasdk | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Restore vitasdk cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: /opt/vitasdk | ||
key: ${{ runner.os }}-vitasdk | ||
fail-on-cache-miss: true | ||
|
||
- name: Cache generator depenedencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
example/std-hello-world/target/ | ||
key: ${{ runner.os }}-cargo-example-${{ hashFiles('example/std-hello-world/Cargo.lock') }} | ||
|
||
- name: Install cargo-make | ||
# Installation fails if cargo-make is cached | ||
continue-on-error: true | ||
run: | | ||
cargo install cargo-make | ||
- name: Install rust nightly | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
profile: minimal | ||
components: rust-src | ||
|
||
- name: Add Vita SDK tools to path | ||
run: | | ||
echo "/opt/vitasdk/bin" >> $GITHUB_PATH | ||
- name: Build example in debug mode | ||
env: | ||
VITASDK: /opt/vitasdk | ||
run: | | ||
cd examples/std-hello-world | ||
cargo +nightly make vpk | ||
- name: Build example in release mode | ||
env: | ||
VITASDK: /opt/vitasdk | ||
run: | | ||
cd examples/std-hello-world | ||
cargo +nightly make --profile release vpk | ||
- name: Upload debug build | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: std-hello-world-debug-build | ||
path: examples/std-hello-world/target/armv7-sony-vita-newlibeabihf/debug/std-hello-world.* | ||
if-no-files-found: error | ||
|
||
- name: Upload release build | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: std-hello-world-release-build | ||
path: examples/std-hello-world/target/armv7-sony-vita-newlibeabihf/release/std-hello-world.* | ||
if-no-files-found: error |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Setup Vita SDK | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
path: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
# This job is also on update-bindings.yml. If you | ||
install-vitasdk: | ||
name: Install Vita SDK | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cache vitasdk | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ inputs.path }} | ||
# Don't really know a good key to use here, but the cache will be | ||
# deleted automatically if it's not used for a week. | ||
key: ${{ runner.os }}-vitasdk | ||
|
||
- name: Checkout VPDM | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: vitasdk/vdpm | ||
|
||
- name: Install | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
env: | ||
VITASDK: ${{ inputs.path }} | ||
run: | | ||
./bootstrap-vitasdk.sh | ||
./install-all.sh |
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