Skip to content

Commit b4303e7

Browse files
mbrossardmathias-arm
authored andcommitted
Github Actions: Add faster CI build for pull requests
1 parent 29339f2 commit b4303e7

File tree

2 files changed

+68
-4
lines changed

2 files changed

+68
-4
lines changed

.github/workflows/linux.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ on:
44
branches:
55
- main
66
- develop
7-
pull_request:
8-
branches:
9-
- main
10-
- develop
117
workflow_dispatch:
128

139
jobs:

.github/workflows/pr.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build DAPLink PR (Linux)
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- develop
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-22.04
12+
strategy:
13+
matrix:
14+
gcc: ['10.3-2021.10']
15+
16+
steps:
17+
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
18+
uses: carlosperate/arm-none-eabi-gcc-action@v1
19+
with:
20+
release: ${{ matrix.gcc }}
21+
path-env-var: ARM_NONE_EABI_GCC_PATH
22+
23+
- name: Cache Python modules
24+
id: cache-python
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
32+
- name: Checkout source files
33+
uses: actions/checkout@v2
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Install Python module
38+
run: |
39+
pip3 install --user -r requirements.txt
40+
41+
- name: Install dependencies
42+
run: |
43+
sudo apt install -y ccache ninja-build
44+
arm-none-eabi-gcc -v | tee log.txt
45+
(git status; git log -1)>> log.txt
46+
47+
- name: Cache CCache
48+
id: ccache
49+
uses: actions/cache@v3
50+
with:
51+
path: .ccache
52+
key: ${{ runner.os }}-gcc-${{ matrix.gcc }}-${{ hashFiles('log.txt') }}
53+
restore-keys: |
54+
${{ runner.os }}-gcc-${{ matrix.gcc }}-
55+
56+
- name: Configure CCache
57+
run: |
58+
ccache --set-config=cache_dir="$GITHUB_WORKSPACE/.ccache"
59+
ccache --set-config=max_size=2Gi
60+
ccache -s -z
61+
62+
- name: Compile
63+
run: |
64+
export PATH="/usr/lib/ccache:$ARM_NONE_EABI_GCC_PATH:/home/runner/.local/bin:$PATH"
65+
progen generate -t cmake_gcc_arm global_workspace
66+
cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -GNinja -S projectfiles/cmake_gcc_arm -B projectfiles/cmake_gcc_arm
67+
ninja -C projectfiles/cmake_gcc_arm
68+
ccache -s

0 commit comments

Comments
 (0)