-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (43 loc) · 1.51 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
name: Compile Firmware
on:
schedule:
- cron: '0 0 */3 * *'
push:
branches:
- master
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Configure Software
run: |
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get install -y cmake gcc g++ automake autoconf libtool make build-essential wget git xz-utils
wget -q https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
- name: Install Compiler
run: |
tar -xf arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
mv arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi ./gcc-arm-none-eabi
rm arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
- name: Configure CMake
run: |
export compiler_path=$(pwd)/gcc-arm-none-eabi/bin
export TZ='Asia/Shanghai'
PATH=$PATH:$compiler_path
mkdir build -p && cd build && cmake ..
- name: Build Hex
run: |
export compiler_path=$(pwd)/gcc-arm-none-eabi/bin
export TZ='Asia/Shanghai'
PATH=$PATH:$compiler_path
cd build && cmake --build . --target power_manager.elf -- -j $(nproc)
- name: Upload Hex
uses: actions/upload-artifact@v3
with:
name: power_manager_hex
path: build/power_manager.hex