-
Notifications
You must be signed in to change notification settings - Fork 2
92 lines (77 loc) · 2.39 KB
/
cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CMake
on:
push:
pull_request:
release:
types: [created]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
name: Linux
runs-on: ubuntu-22.04
env:
CI_PROJECT_ROOT: ${{ github.workspace }}/src-${{ github.sha }}
CI_BUILD_ROOT: ${{ github.workspace }}
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache
steps:
- name: "CCache: ~/.ccache Fixup"
run: |
mkdir -p /home/runner/.ccache
- name: "CCache: Restore saved cache"
uses: actions/cache@v4
with:
path: /home/runner/.ccache
key: ccache-${{ github.ref }}-${{ github.sha }}
restore-keys: |
ccache-${{ github.ref }}-${{ github.sha }}
ccache-${{ github.ref }}
- name: "CCache: Install ccache."
run: sudo apt update && sudo apt install ccache
- name: Prepare Code
uses: actions/checkout@v4
with:
path: src-${{ github.sha }}
submodules: true
- name: Install Arm GNU Toolchain (arm-none-eabi-gcc)
uses: carlosperate/arm-none-eabi-gcc-action@v1
with:
release: '13.3.Rel1'
- name: "Prepare tools & dependencies"
shell: bash
run: |
source $CI_PROJECT_ROOT/ci/cpp.sh && ci_debug
ci_prepare_all
- name: "CMake: Configure"
shell: bash
run: |
source $CI_PROJECT_ROOT/ci/cpp.sh && ci_debug
ci_cmake_configure
- name: "CMake: Build"
shell: bash
run: |
source $CI_PROJECT_ROOT/ci/cpp.sh && ci_debug
ccache --zero-stats || true
ci_cmake_build
ccache --show-stats || true
ci_cmake_package
- name: "CMake: Post"
shell: bash
run: |
cd ${{ env.CI_BUILD_ROOT }}
echo "RELEASE_FILE=$(ls *.uf2 | cut -d. -f1)" >> $GITHUB_ENV
- name: "Artifacts: Upload .uf2"
uses: actions/upload-artifact@v4
with:
name: ${{ env.RELEASE_FILE }}.uf2
path: ${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.uf2
- name: "Release: Upload Files"
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.uf2
${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.zip
${{ env.CI_BUILD_ROOT }}/${{ env.RELEASE_FILE }}.tar.gz