-
Notifications
You must be signed in to change notification settings - Fork 2
133 lines (123 loc) · 4.18 KB
/
c-cpp.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: C/C++ CI
on:
push:
branches: [ master github_actions_fix ]
pull_request:
branches: [ master ]
schedule:
- cron: '30 4 * * 1'
workflow_dispatch:
branches: [ master ]
# note that I need to manually set the path for the arm-none-eabi-gcc exe
# after it comes out of the cache. I don't understand why I need to do that.
jobs:
build-gcc:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Check cache for Embedded Arm Toolchain arm-none-eabi-gcc
id: cache-toolchain
uses: actions/cache@v2
env:
cache-name: cache-toolchain-10-2020-q4
with:
path: ${{ runner.temp }}/arm-none-eabi
key: ${{ runner.os }}-buildv1-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-buildv1-${{ env.cache-name }}
- name: Install Embedded Arm Toolchain arm-none-eabi-gcc
if: steps.cache-toolchain.outputs.cache-hit != 'true' # Install toolchain if not found in cache
uses: fiam/[email protected]
with:
release: '10-2020-q4' # The arm-none-eabi-gcc release to use.
# Directory to unpack GCC to. Defaults to a temporary directory.
directory: ${{ runner.temp }}/arm-none-eabi
- name: make with GCC, debug build, Rev1
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
make -k DEBUG=1 REV1=1
- name: make with GCC, debug build, Rev2
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
make REV1=1 clean
make -k DEBUG=1 REV2=1
- name: make with GCC, Rev1
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
make REV1=1 clean
make -k REV1=1
- name: make with GCC, Rev 2
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
make REV1=1 clean
make -k REV2=1
build-clang:
# this build also needs arm-none-eabi-gcc as some of the clang sysroot stuff depends on it.
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Install LLVM and Clang
uses: KyleMayes/[email protected]
with:
version: "14.0"
directory: ${{ runner.temp }}/llvm
- name: Check cache for Embedded Arm Toolchain arm-none-eabi-gcc
id: cache-toolchain
uses: actions/cache@v2
env:
cache-name: cache-toolchain-10-2020-q4
with:
path: ${{ runner.temp }}/arm-none-eabi
key: ${{ runner.os }}-buildv1-${{ env.cache-name }}
restore-keys: ${{ runner.os }}-buildv1-${{ env.cache-name }}
- name: Install Embedded Arm Toolchain arm-none-eabi-gcc
if: steps.cache-toolchain.outputs.cache-hit != 'true' # Install toolchain if not found in cache
uses: fiam/[email protected]
with:
release: '10-2020-q4' # The arm-none-eabi-gcc release to use.
# Directory to unpack GCC to. Defaults to a temporary directory.
directory: ${{ runner.temp }}/arm-none-eabi
- name: make with CLANG, Rev 1
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
make -k COMPILER=clang REV1=1
- name: make with CLANG, Rev 2
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
make -k COMPILER=clang REV1=1 clean
make -k COMPILER=clang REV2=1
clang-format:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v3
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
files_ignore: |
**/*.yml
**/*.py
**/*.xml
**/*.ipynb
.clang*
.git*
**/*.sh
**/*.def
**/Makefile
makedefs
**/*.md
**/.pylintrc
**/.gitignore
**/.git*
**/LICENSE
- name: Format changed files
if: steps.changed-files.outputs.any_changed == 'true'
uses: DoozyX/[email protected]
with:
source: ${{ steps.changed-files.outputs.all_changed_files }}
extensions: 'h,c'
clangFormatVersion: 11
inplace: false
style: file