forked from ARMmbed/DAPLink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github Actions: Add faster CI build for pull requests
- Loading branch information
1 parent
29339f2
commit b4303e7
Showing
2 changed files
with
68 additions
and
4 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 |
---|---|---|
|
@@ -4,10 +4,6 @@ on: | |
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
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,68 @@ | ||
name: Build DAPLink PR (Linux) | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
gcc: ['10.3-2021.10'] | ||
|
||
steps: | ||
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc) | ||
uses: carlosperate/arm-none-eabi-gcc-action@v1 | ||
with: | ||
release: ${{ matrix.gcc }} | ||
path-env-var: ARM_NONE_EABI_GCC_PATH | ||
|
||
- name: Cache Python modules | ||
id: cache-python | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Checkout source files | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Python module | ||
run: | | ||
pip3 install --user -r requirements.txt | ||
- name: Install dependencies | ||
run: | | ||
sudo apt install -y ccache ninja-build | ||
arm-none-eabi-gcc -v | tee log.txt | ||
(git status; git log -1)>> log.txt | ||
- name: Cache CCache | ||
id: ccache | ||
uses: actions/cache@v3 | ||
with: | ||
path: .ccache | ||
key: ${{ runner.os }}-gcc-${{ matrix.gcc }}-${{ hashFiles('log.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-gcc-${{ matrix.gcc }}- | ||
- name: Configure CCache | ||
run: | | ||
ccache --set-config=cache_dir="$GITHUB_WORKSPACE/.ccache" | ||
ccache --set-config=max_size=2Gi | ||
ccache -s -z | ||
- name: Compile | ||
run: | | ||
export PATH="/usr/lib/ccache:$ARM_NONE_EABI_GCC_PATH:/home/runner/.local/bin:$PATH" | ||
progen generate -t cmake_gcc_arm global_workspace | ||
cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -GNinja -S projectfiles/cmake_gcc_arm -B projectfiles/cmake_gcc_arm | ||
ninja -C projectfiles/cmake_gcc_arm | ||
ccache -s |