-
Notifications
You must be signed in to change notification settings - Fork 6
137 lines (116 loc) · 4.52 KB
/
build.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: build
on: [push, pull_request]
jobs:
windows:
runs-on: windows-latest
steps:
- name: Checkout with submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache Arm GNU Toolchain and Ninja
uses: actions/cache@v3
id: cache
with:
key: ${{ runner.OS }}-cache-${{ hashFiles('.github/workflows/build.yml') }}
path: |
C:\arm-gnu-toolchain
C:\ninja
- name: Install Arm GNU Toolchain
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl.exe -L https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-mingw-w64-i686-arm-none-eabi.zip -o arm-gnu-toolchain.zip
mkdir C:\arm-gnu-toolchain
tar -xf arm-gnu-toolchain.zip -C C:\arm-gnu-toolchain --strip-components=1
- name: Install Ninja
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl.exe -L https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -o ninja-win.zip
mkdir C:\ninja
tar -xf ninja-win.zip -C C:\ninja
- name: Build
run: |
$env:Path = "C:\arm-gnu-toolchain\bin;C:\ninja;" + $env:Path
make
- name: Set artifacts suffix (if tag)
if: startsWith(github.ref, 'refs/tags/') == true
run: Add-Content $env:GITHUB_ENV "git_suffix=$(git describe --tags --abbrev=0)"
- name: Set artifacts suffix (if branch)
if: startsWith(github.ref, 'refs/tags/') != true
run: Add-Content $env:GITHUB_ENV "git_suffix=$(Write-Output "$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse --short HEAD)")"
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: stm32f4-${{env.git_suffix}}
path: |
build/stm32f4.bin
build/stm32f4.elf
build/stm32f4.map
if-no-files-found: error
linux:
runs-on: ubuntu-22.04
steps:
- name: Checkout with submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache Arm GNU Toolchain, xtensa-esp-elf toolchain and esp-idf Python environment
uses: actions/cache@v3
id: cache
with:
key: ${{ runner.OS }}-cache-${{ hashFiles('.github/workflows/build.yml') }}
path: |
~/arm-gnu-toolchain
~/xtensa-esp-elf
~/.espressif
- name: Install Arm GNU Toolchain
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl -L https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz -o arm-gnu-toolchain.tar.xz
mkdir ~/arm-gnu-toolchain
tar -xf arm-gnu-toolchain.tar.xz -C ~/arm-gnu-toolchain --strip-components=1
- name: Install xtensa-esp-elf toolchain
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl -L https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20240530/xtensa-esp-elf-13.2.0_20240530-x86_64-linux-gnu.tar.xz -o xtensa-esp-elf-toolchain.tar.xz
tar -xf xtensa-esp-elf-toolchain.tar.xz -C ~/
- name: Install esp-idf Python environment
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
python third_party/esp-idf/tools/idf_tools.py install-python-env
- name: Install Ninja and Python esp-idf Python requirements
run: |
sudo apt update && sudo apt install ninja-build
python -m pip install -r third_party/esp-idf/tools/requirements/requirements.core.txt
python -m pip install -U pyparsing --force
- name: Install dependencies
run: sudo apt update && sudo apt install ninja-build
- name: Build STM32F4
run: |
export PATH=~/arm-gnu-toolchain/bin:$PATH
make
- name: Build STM32F0
run: |
export PATH=~/arm-gnu-toolchain/bin:$PATH
make clean
make stm32f0
make
- name: Build STM32F1
run: |
export PATH=~/arm-gnu-toolchain/bin:$PATH
make clean
make stm32f1
make
- name: Build RP2040
run: |
export PATH=~/arm-gnu-toolchain/bin:$PATH
make clean
make rp2040
make
- name: Build ESP32S3
run: |
export PATH=~/xtensa-esp-elf/bin:$PATH
make clean
make esp32s3
make