-
Notifications
You must be signed in to change notification settings - Fork 3
137 lines (118 loc) · 4.12 KB
/
main.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
134
135
136
137
name: CI
on:
# Run on all pull requests and all pushes to master
push:
branches: [ master ]
pull_request:
# Allow running this workflow manually
workflow_dispatch:
env:
# Set defines for builds/tests
DEFINES: "LOG_LEVEL_VERBOSITY=LOG_LEVEL_WARN"
jobs:
build:
runs-on: ubuntu-18.04
timeout-minutes: 12
steps:
- uses: actions/checkout@v2
# TODO: cache all the setup
- name: Setup directories
run: |
# create directory that will be on the PATH
mkdir -p ~/.local/bin
echo "${HOME}/.local/bin" >> $GITHUB_PATH
mkdir -p ~/source
- name: Install gcc, clang, clang-format
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-fast -y install gcc-6
sudo apt-fast -y install clang-5.0
sudo apt-fast -y install clang-format-5.0
sudo apt-fast -y install libc6-i386
# for vcan module
sudo apt-fast -y install linux-modules-extra-$(uname -r)
ln -sf `which gcc-6` ~/.local/bin/gcc
ln -sf `which clang-5.0` ~/.local/bin/clang
ln -sf `which clang-format-5.0` ~/.local/bin/clang-format
- name: Install STM32 toolchain
env:
GCC_PATH: gcc-arm-none-eabi-6-2017-q2-update
GCC_ARCHIVE_PATH: gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
GCC_URL: https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
run: |
cd ${HOME}
wget -nv $GCC_URL
mkdir -p $GCC_PATH
tar -xjf $GCC_ARCHIVE_PATH
echo "${HOME}/${GCC_PATH}/bin" >> $GITHUB_PATH
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install Python tooling
run: |
pip install --user virtualenv
pip install --upgrade pip
pip install --upgrade setuptools
sudo apt install python3-testresources
make install_requirements_ci
- name: Force PATH to update
run: hash -r
- name: Print versions of everything
run: |
arm-none-eabi-gcc --version
arm-none-eabi-objcopy --version
arm-none-eabi-objdump --version
arm-none-eabi-size --version
arm-none-eabi-gcc-ar --version
arm-none-eabi-gdb --version
gcc --version
make --version
clang --version
clang-format --version
.venv/bin/pip3 freeze
- name: Format and lint
run: |
make test_format
make lint
make pylint
- name: Build codegen
run: |
make codegen
make codegen_dbc
- name: Check for uncommitted codegen changes
id: check-uncommitted-changes
continue-on-error: true
# https://stackoverflow.com/a/3879077
run: |
git update-index --refresh || true
git diff-index --quiet HEAD --
- name: Post PR comment on uncommitted changes
if: ${{ steps.check-uncommitted-changes.outcome == 'failure' }}
uses: actions/github-script@v4
with:
script: |
const fs = require('fs');
const comment = fs.readFileSync(
'./.github/workflows/uncommitted-codegen-changes.md', 'utf8');
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment,
});
- name: Fail on uncommitted changes
if: ${{ steps.check-uncommitted-changes.outcome == 'failure' }}
run: exit 1
- name: Build stm32f0xx
id: build-stm32
run: |
make build_all PLATFORM=stm32f0xx DEFINE="${DEFINES}"
make clean
- name: Build and test
id: build-test
run: |
make build_all PLATFORM=x86 DEFINE="${DEFINES}"
make test_all PLATFORM=x86 DEFINE="${DEFINES}"
make pytest_all
make build_all PLATFORM=x86 COMPILER=clang DEFINE="${DEFINES}"