Repository navigation
80 lines (69 loc) · 2.15 KB
/
Copy pathpico_examples.yml
File metadata and controls
80 lines (69 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build Pico Examples
# Build only when the shared code, the rp2xxx backend, or the Pico examples change
on:
pull_request:
branches: [main]
paths:
- "src/*.c"
- "src/host/**"
- "src/target/**"
- "src/backend/rp2xxx/**"
- "include/joybus/**"
- "CMakeLists.txt"
- "examples/pico-sdk/**"
- ".github/workflows/pico_examples.yml"
workflow_dispatch:
env:
PICO_SDK_VERSION: 2.2.0
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk
jobs:
# Cache the Pico SDK once so matrix jobs only restore, never racing to save.
setup:
runs-on: ubuntu-latest
steps:
- name: Cache Pico SDK
id: cache-pico-sdk
uses: actions/cache@v5
with:
path: pico-sdk
key: pico-sdk-${{ env.PICO_SDK_VERSION }}
- name: Install Pico SDK
if: steps.cache-pico-sdk.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch ${{ env.PICO_SDK_VERSION }} \
--recurse-submodules --shallow-submodules \
https://github.com/raspberrypi/pico-sdk.git pico-sdk
build-pico-examples:
needs: setup
runs-on: ubuntu-latest
strategy:
matrix:
example:
- gcn-adapter-usb-hid
- gcn-host
- gcn-target
- gcn-target-usb-serial
- n64-adapter-usb-hid
- n64-host
- n64-target
steps:
- name: Checkout repository
uses: actions/checkout@v6
# Setup dependencies
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build python3 build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib
# Restore the Pico SDK populated by the setup job
- name: Restore Pico SDK
uses: actions/cache/restore@v5
with:
path: pico-sdk
key: pico-sdk-${{ env.PICO_SDK_VERSION }}
fail-on-cache-miss: true
# Build each example
- name: Build project
working-directory: examples/pico-sdk/${{ matrix.example }}
run: |
cmake -Bbuild -GNinja .
cmake --build build