Skip to content

Commit ae46267

Browse files
authored
WIP
1 parent d56b85e commit ae46267

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v3
4141

42-
- name: Add /tmp/local/bin to PATH
43-
run: |
44-
echo "/tmp/local/bin" >> $GITHUB_PATH
45-
4642
- name: Restore toolchain dependencies
4743
id: cache-before
4844
uses: actions/cache/restore@v3
@@ -51,19 +47,45 @@ jobs:
5147
/tmp/rbdev-dl
5248
/tmp/local
5349
/tmp/rbdev-build
50+
/tmp/rockboxdev_path_modifications
5451
key: ${{ runner.os }}-toolchain-${{ matrix.arch }}-${{ hashFiles('tools/rockboxdev.sh') }}
5552
restore-keys: |
5653
${{ runner.os }}-toolchain-${{ matrix.arch }}-
5754
${{ runner.os }}-toolchain-
5855
59-
- name: make it all
56+
- name: Restore PATH from cached modifications
57+
if: steps.cache-before.outputs.cache-hit == 'true'
58+
run: |
59+
# Append the cached PATH modifications to GITHUB_PATH
60+
while IFS= read -r line; do
61+
echo "$line" >> $GITHUB_PATH
62+
done < /tmp/rockboxdev_path_modifications
63+
64+
- name: Install dependencies
6065
run: |
6166
sudo apt-get update
62-
sudo apt-get install automake bison build-essential ccache flex libc6-dev libgmp3-dev libmpfr-dev libsdl1.2-dev libtool-bin texinfo zip gawk wget libmpc-dev gettext
67+
sudo apt-get install -y automake bison build-essential ccache flex libc6-dev libgmp3-dev libmpfr-dev \
68+
libsdl1.2-dev libtool-bin texinfo zip gawk wget libmpc-dev gettext
69+
70+
- name: Run rockboxdev.sh and save PATH modifications
71+
if: steps.cache-before.outputs.cache-hit != 'true'
72+
run: |
73+
echo "$PATH" > /tmp/original_path
6374
cd tools
6475
chmod +x rockboxdev.sh
6576
sudo ./rockboxdev.sh --target=${{matrix.arch}}
6677
cd ..
78+
79+
# Compare the modified PATH with the original PATH
80+
comm -13 <(sort /tmp/original_path) <(echo "$PATH" | tr ':' '\n' | sort) > /tmp/rockboxdev_path_modifications
81+
82+
# Append the modifications to GITHUB_PATH
83+
while IFS= read -r line; do
84+
echo "$line" >> $GITHUB_PATH
85+
done < /tmp/rockboxdev_path_modifications
86+
87+
- name: Build Rockbox
88+
run: |
6789
mkdir build
6890
cd build
6991
../tools/configure --target=${{matrix.platform}} --type=N
@@ -78,10 +100,10 @@ jobs:
78100
/tmp/rbdev-dl
79101
/tmp/local
80102
/tmp/rbdev-build
103+
/tmp/rockboxdev_path_modifications
81104
key: ${{ runner.os }}-toolchain-${{ matrix.arch }}-${{ hashFiles('tools/rockboxdev.sh') }}
82105
restore-keys: |
83106
${{ runner.os }}-toolchain-${{ matrix.arch }}-
84-
${{ runner.os }}-toolchain-
85107
86108
- name: Upload build
87109
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)