-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.86 KB
/
ci.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
name: build-artifacts
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v3
with:
ref: main # Ensure we're checking out the main branch
submodules: true # Initialize and update submodules automatically
fetch-depth: 0 # Fetch all history to ensure proper submodule handling
- name: Initialize submodules (in case it's not done automatically)
run: |
git submodule sync
git submodule update --init --recursive
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y gcc-arm-none-eabi make
- name: Build project
run: cd firmware/iot-risk-logger-stm32l4 && make all
- name: Calculate Flash and RAM usage
run: |
SIZE_OUTPUT=$(arm-none-eabi-size build/iot-risk-logger-stm32l4.elf)
TEXT_SIZE=$(echo "$SIZE_OUTPUT" | awk 'NR==2 {print $1}')
DATA_SIZE=$(echo "$SIZE_OUTPUT" | awk 'NR==2 {print $2}')
BSS_SIZE=$(echo "$SIZE_OUTPUT" | awk 'NR==2 {print $3}')
FLASH_USAGE=$((TEXT_SIZE + DATA_SIZE))
RAM_USAGE=$((DATA_SIZE + BSS_SIZE))
echo "Flash usage: $FLASH_USAGE bytes" > flash_usage.txt
echo "RAM usage: $RAM_USAGE bytes" > ram_usage.txt
- name: Checkout artifacts branch
run: |
git fetch origin artifacts
git checkout artifacts
git merge main --no-edit # Merge changes from main into artifacts
- name: Update artifacts
run: |
mv flash_usage.txt artifacts/
mv ram_usage.txt artifacts/
git add artifacts/flash_usage.txt artifacts/ram_usage.txt
git commit -m "Update Flash and RAM usage artifacts"
git push origin artifacts