WIP #89
This file contains hidden or 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
| name: Rockbox build | |
| on: [workflow_dispatch, push, pull_request] | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Rocker | |
| # Other arch targets https://github.com/bahusoid/rockbox/blob/992dfe0118f367533fe23170b1459c2818a629a1/tools/rockboxdev.sh#L697-L701 | |
| arch: y | |
| # Other platform targets https://github.com/Rockbox/rockbox/blob/dd1fbd51fc7bb3fa7237b3bc34335e99bef29e35/tools/configure#L1560-L1615 | |
| platform: 240 | |
| - name: xDuoo X3II | |
| arch: y | |
| platform: 242 | |
| - name: Samsung YP-R0 | |
| arch: x | |
| platform: 205 | |
| - name: clipZip | |
| arch: a | |
| platform: 65 | |
| - name: mRobe500 | |
| arch: a | |
| platform: 70 | |
| - name: IriverH300 | |
| arch: m | |
| platform: 11 | |
| runs-on: ubuntu-22.04 | |
| name: ${{matrix.name}} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Restore toolchain dependencies | |
| id: cache-before | |
| uses: actions/cache/restore@v3 | |
| with: | |
| path: | | |
| /tmp/rbdev-dl | |
| /tmp/local | |
| /tmp/rbdev-build | |
| /tmp/rockboxdev_path_modifications | |
| key: ${{ runner.os }}-toolchain-${{ matrix.arch }}-${{ hashFiles('tools/rockboxdev.sh') }} | |
| restore-keys: | | |
| ${{ runner.os }}-toolchain-${{ matrix.arch }}- | |
| ${{ runner.os }}-toolchain- | |
| - name: Restore PATH from cached modifications | |
| if: steps.cache-before.outputs.cache-hit == 'true' | |
| run: | | |
| # Append the cached PATH modifications to GITHUB_PATH | |
| while IFS= read -r line; do | |
| echo "$line" >> $GITHUB_PATH | |
| done < /tmp/rockboxdev_path_modifications | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y automake bison build-essential ccache flex libc6-dev libgmp3-dev libmpfr-dev \ | |
| libsdl1.2-dev libtool-bin texinfo zip gawk wget libmpc-dev gettext | |
| - name: Run rockboxdev.sh and save PATH modifications | |
| if: steps.cache-before.outputs.cache-hit != 'true' | |
| run: | | |
| echo "$PATH" > /tmp/original_path | |
| cd tools | |
| chmod +x rockboxdev.sh | |
| sudo ./rockboxdev.sh --target=${{matrix.arch}} | |
| cd .. | |
| # Compare the modified PATH with the original PATH | |
| comm -13 <(sort /tmp/original_path) <(echo "$PATH" | tr ':' '\n' | sort) > /tmp/rockboxdev_path_modifications | |
| # Append the modifications to GITHUB_PATH | |
| while IFS= read -r line; do | |
| echo "$line" >> $GITHUB_PATH | |
| done < /tmp/rockboxdev_path_modifications | |
| - name: Build Rockbox | |
| run: | | |
| mkdir build | |
| cd build | |
| ../tools/configure --target=${{matrix.platform}} --type=N | |
| make -j | |
| make zip | |
| - name: Cache toolchain dependencies | |
| if: steps.cache-before.outputs.cache-hit != 'true' | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| /tmp/rbdev-dl | |
| /tmp/local | |
| /tmp/rbdev-build | |
| /tmp/rockboxdev_path_modifications | |
| key: ${{ runner.os }}-toolchain-${{ matrix.arch }}-${{ hashFiles('tools/rockboxdev.sh') }} | |
| restore-keys: | | |
| ${{ runner.os }}-toolchain-${{ matrix.arch }}- | |
| - name: Upload build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{matrix.name}}.zip | |
| path: build/rockbox.zip | |
| - name: Upload log | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: ${{matrix.name}}Logs | |
| path: /tmp/rbdev-build/*.log |