forked from rusefi/wideband
-
Notifications
You must be signed in to change notification settings - Fork 9
83 lines (70 loc) · 2.67 KB
/
Copy pathbuild-f0-for-rusefi.yaml
File metadata and controls
83 lines (70 loc) · 2.67 KB
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
name: Build F0 Firmware
on:
workflow_dispatch:
push:
jobs:
build-f0-firmware:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
# Build machines don't have arm-none-eabi gcc, so let's download it and put it on the path
- name: Download & Install GCC
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: | # Compiler hosted on our other git repo - avoids having to download from the nice folks at ARM every time
wget 'https://github.com/rusefi/build_support/raw/master/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz' -O compiler.tar.xz
tar -xvf compiler.tar.xz
echo "::add-path::`pwd`/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin"
# Make sure the compiler we just downloaded works - just print out the version
- name: Test Compiler
run: arm-none-eabi-gcc -v
- name: Install build tools
run: |
sudo apt-get install srecord libarchive-zip-perl
- name: Build Firmware
working-directory: ./firmware/boards/f0_module
run: ./build_wideband.sh
- name: Commit fresh generated header
if: ${{ github.ref == 'refs/heads/prod-2025-05'}}
run: |
git status
git remote -v
git config --local user.email "action@github.com"
git config --local user.name "GitHub F0 header Action"
git add "for_rusefi/*.h"
OUT=$(git commit -m "Auto-generated header" 2>&1) || echo "commit failed, finding out why"
if echo "$OUT" | grep 'nothing to commit\|no changes added'; then
echo "header: looks like nothing to commit"
exit 0
elif echo "$OUT" | grep 'changed'; then
echo "COMMIT=true" >> $GITHUB_ENV
echo "header: looks like something has changed"
exit 0
else
echo "header: looks like something unexpected: [$OUT]"
exit 1
fi
- name: Git Status
run: |
git status
- name: Git Stash
if: ${{env.COMMIT == 'true'}}
run: |
git stash
- name: Git Rebase
if: ${{env.COMMIT == 'true'}}
run: |
echo Fetching only current branch to make things quicker
git fetch $(git rev-parse --symbolic-full-name --abbrev-ref @{upstream} | sed 's!/! !')
git rebase
- name: Git Status again
run: |
git status
- name: Push fresh header
if: ${{ env.COMMIT == 'true'}}
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.ref }}