Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ccache in Github Actions #5

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 24 additions & 31 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,18 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Cache Embedded Arm Toolchain
id: cache-arm-gcc
uses: actions/cache@v2
env:
cache-name: arm-gcc-10.3-2021-07
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
path: ${{ runner.temp }}/arm-gcc
key: ${{ runner.os }}-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-${{ env.cache-name }}
release: '10.3-2021.10'
path-env-var: ARM_NONE_EABI_GCC_PATH

- name: Cache Python modules
uses: actions/cache@v2
id: cache-python
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
Expand All @@ -42,45 +39,41 @@ jobs:
run: |
pip3 install --user -r requirements.txt

- name: Install Embedded Arm Toolchain
if: steps.cache-arm-gcc.outputs.cache-hit != 'true'
run: |
curl -O -L https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2
md5sum gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2
echo Installing in ${{ runner.temp }}/arm-gcc
mkdir -p ${{ runner.temp }}/arm-gcc
tar jvxf gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2 -C ${{ runner.temp }}/arm-gcc --strip-components 1

- name: Install dependencies
run: |
sudo apt install -y ccache ninja-build
export PATH=/usr/lib/ccache:${{ runner.temp }}/arm-gcc/bin/:/home/runner/.local/bin:$PATH
for i in ${{ runner.temp }}/arm-gcc/bin/* ; do sudo ln -s /usr/bin/ccache /usr/lib/ccache/$(basename $i); done
ccache --set-config=cache_dir="$GITHUB_WORKSPACE"
ccache --set-config=cache_dir="$GITHUB_WORKSPACE/.ccache"
ccache --set-config=max_size=2Gi
ccache -z -s
export PATH="/usr/lib/ccache:$ARM_NONE_EABI_GCC_PATH:/home/runner/.local/bin:$PATH"
for i in "$ARM_NONE_EABI_GCC_PATH/"* ; do sudo ln -s /usr/bin/ccache /usr/lib/ccache/$(basename $i); done
arm-none-eabi-gcc -v | tee log.txt
(git status; git log -1 )>> log.txt
(git status; git log -1)>> log.txt

- name: Cache CCache
id: ccache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: .ccache
key: ${{ runner.os }}-ccache-${{ hashFiles('log.txt') }}
restore-keys: ${{ runner.os }}-ccache-
restore-keys: |
${{ runner.os }}-ccache-

- name: Configure CCache
run: |
ccache --set-config=cache_dir="$GITHUB_WORKSPACE/.ccache"
ccache --set-config=max_size=2Gi
ccache -s
ccache -z
ccache -s

- name: Compile
run: |
export PATH="/usr/lib/ccache:${{ runner.temp }}/arm-gcc/bin/:/home/runner/.local/bin:$PATH"
export PATH="/usr/lib/ccache:$ARM_NONE_EABI_GCC_PATH:/home/runner/.local/bin:$PATH"
python tools/progen_compile.py --release --parallel -v
(ls -lR firmware_*; ccache -s; arm-none-eabi-gcc -v) | tee log.txt
mkdir bootloaders
cp projectfiles/make_gcc_arm/*_bl/build/*_crc.{bin,hex} bootloaders
(ls -lR firmware_*; ccache -s; arm-none-eabi-gcc -v) | tee log.txt

- name: Upload test artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: firmware-dev-${{github.run_number}}
path: |
Expand Down
Loading