Skip to content

Commit bcc7e35

Browse files
Amri KarismaAmri Karisma
authored andcommitted
Merge origin/main into mazduino
2 parents 625c01d + 6e35287 commit bcc7e35

43 files changed

Lines changed: 53883 additions & 265 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Firmware Matrix Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
generate-matrix:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
matrix: ${{ steps.set-matrix.outputs.matrix }}
13+
steps:
14+
- uses: actions/checkout@v6
15+
with:
16+
submodules: true
17+
18+
- name: Set matrix
19+
id: set-matrix
20+
run: |
21+
export EVENT_NAME="${{github.event_name}}"
22+
export RUN_ATTEMPT="${{github.run_attempt}}"
23+
read -d '' COMMIT_MESSAGE << EOM || true
24+
${{ github.event.head_commit.message }}
25+
EOM
26+
export COMMIT_MESSAGE
27+
bash ext/rusefi/firmware/bin/generate_matrix.sh boards
28+
echo "matrix=$(bash ext/rusefi/firmware/bin/generate_matrix.sh boards)" >> $GITHUB_OUTPUT
29+
30+
build-firmware:
31+
runs-on: ubuntu-latest
32+
needs: [
33+
generate-matrix]
34+
35+
if: ${{ ! contains(needs.generate-matrix.outputs.matrix, '[]') }}
36+
strategy:
37+
# Let all builds finish even if one fails early
38+
fail-fast: false
39+
matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}}
40+
41+
steps:
42+
- uses: actions/checkout@v6
43+
with:
44+
submodules: true
45+
46+
- name: Set run variables
47+
id: set-variables
48+
run: |
49+
echo ${{matrix.meta-info}}
50+
echo MATRIX_META_PATH=${{matrix.meta-info}} >> $GITHUB_OUTPUT
51+
if [ "${{github.event_name}}" = "schedule" ]; then
52+
echo "release_date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
53+
fi
54+
if [ "${{github.event_name}}" == "push" -o "${{github.event_name}}" == "schedule" -o "${{github.event_name}}" == "workflow_dispatch" ] && [ "${{github.ref}}" == "refs/heads/master" -o "${{github.ref}}" == "refs/heads/main" ]; then
55+
echo 'extra_makefile_targets=build_both_bundles' >> $GITHUB_OUTPUT
56+
# uncomment this line for upload! echo 'upload=ftp_upload_bundles' >> $GITHUB_OUTPUT
57+
# not pushing from matrix
58+
echo 'push=true' >> $GITHUB_OUTPUT
59+
echo 'sim=true' >> $GITHUB_OUTPUT
60+
else
61+
echo 'push=false' >> $GITHUB_OUTPUT
62+
echo 'sim=false' >> $GITHUB_OUTPUT
63+
fi
64+
65+
#
66+
# export ABSOLUTE_BOARD_DIR=/home/rusefi/fw-custom-example/boards/board1
67+
# cd /home/rusefi/fw-custom-example/ext/rusefi
68+
# export
69+
70+
71+
- uses: ./ext/rusefi/.github/workflows/custom-board-build
72+
with:
73+
meta_info: ${{steps.set-variables.outputs.MATRIX_META_PATH}}
74+
# bug? feature? 'release_date' above is $GITHUB_ENV not $GITHUB_OUTPUT
75+
new_tag: ${{steps.set-variables.outputs.release_date}}
76+
artifacts: bin srec hex list map elf bundle autoupdate
77+
# see above about un-commenting
78+
uploads: ini ${{steps.set-variables.outputs.upload}}
79+
push: ${{steps.set-variables.outputs.push}}
80+
run_simulator: ${{ steps.set-variables.outputs.sim }}
81+
MY_REPO_PAT: ${{secrets.MY_REPO_PAT}}
82+
RUSEFI_ONLINE_FTP_USER: ${{secrets.RUSEFI_ONLINE_FTP_USER}}
83+
RUSEFI_ONLINE_FTP_PASS: ${{secrets.RUSEFI_ONLINE_FTP_PASS}}
84+
RUSEFI_FTP_SERVER: ${{secrets.RUSEFI_FTP_SERVER}}
85+
RUSEFI_SSH_SERVER: ${{secrets.RUSEFI_SSH_SERVER}}
86+
RUSEFI_SSH_USER: ${{secrets.RUSEFI_SSH_USER}}
87+
RUSEFI_SSH_PASS: ${{secrets.RUSEFI_SSH_PASS}}
88+
ADDITIONAL_ENV: ${{secrets.ADDITIONAL_ENV}}

.github/workflows/unit-tests.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build Unit Tests
2+
3+
on:
4+
schedule:
5+
- cron: '0 1 * * *'
6+
push:
7+
# pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-firmware:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
18+
- uses: actions/setup-java@v4
19+
with:
20+
distribution: 'zulu'
21+
java-version: '11'
22+
23+
- name: Test Java Compiler
24+
shell: bash
25+
run: javac -version
26+
27+
- name: Print Compiler version
28+
shell: bash
29+
run: gcc -v
30+
31+
- name: Set Env Variables
32+
id: set-env-variables
33+
shell: bash
34+
run: |
35+
: Set Env Variables
36+
ABSOLUTE_BOARD_DIR=${{github.workspace}}
37+
echo "ABSOLUTE_BOARD_DIR=$ABSOLUTE_BOARD_DIR" >> $GITHUB_ENV
38+
echo "META_OUTPUT_ROOT_FOLDER=$(realpath --relative-to=ext/rusefi/firmware generated)/" >> $GITHUB_ENV
39+
40+
- name: Compile and execute Unit Tests
41+
shell: bash
42+
run: |
43+
: Compile and execute Unit Tests
44+
bash bin/compile_and_run_unit_tests.sh

_compile_simulator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22
cd ext/rusefi/firmware/
3-
bash bin/compile.sh ../../../meta-info.env ../simulator/build/rusefi_simulator
3+
bash bin/compile.sh ../../../meta-info.env ../simulator/build/rusefi_simulator.linux

bin/compile_and_run_unit_tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SCRIPT_DIR=$(dirname "$0")
6+
7+
source $SCRIPT_DIR/make_unit_tests.sh
8+
9+
timeout 20m build/rusefi_test

bin/make_unit_tests.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SCRIPT_DIR=$(dirname "$0")
6+
7+
cd $SCRIPT_DIR/../ext/rusefi/unit_tests/
8+
9+
# This full path of the unit tests directory
10+
FDIR=$(pwd -P)
11+
12+
MI="../../../meta-info.env"
13+
14+
if [ -f "$FDIR/$MI" ]; then
15+
true
16+
# If the file exists relative to our current directory, get the full path
17+
elif [ -f "$MI" ]; then
18+
MI=$(realpath "$MI")
19+
else
20+
echo "Could not find $MI"
21+
exit 1
22+
fi
23+
24+
source ../firmware/config/boards/common_script_read_meta_env.inc "$MI"
25+
26+
make -j$(nproc) "$@"

boards/board1/board.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ifneq ($(PROJECT_CPU),simulator)
2+
BOARDCPPSRC += \
3+
$(BOARD_DIR)/board_configuration.cpp \
4+
5+
endif
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "pch.h"
2+
#include "board_overrides.h"
3+
4+
Gpio getCommsLedPin() {
5+
return Gpio::Unassigned;
6+
}
7+
8+
Gpio getRunningLedPin() {
9+
return Gpio::Unassigned;
10+
}
11+
12+
Gpio getWarningLedPin() {
13+
return Gpio::Unassigned;
14+
}
15+
16+
void setup_custom_board_overrides() {
17+
18+
}

boards/board1/meta-info.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# lower-case is required if using TS automatic .ini download
2+
SHORT_BOARD_NAME=board1
3+
PROJECT_CPU=ARCH_STM32F4

boards/board2/board.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ifneq ($(PROJECT_CPU),simulator)
2+
BOARDCPPSRC += \
3+
$(BOARD_DIR)/board_configuration.cpp \
4+
5+
endif
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "pch.h"
2+
#include "board_overrides.h"
3+
4+
Gpio getCommsLedPin() {
5+
return Gpio::Unassigned;
6+
}
7+
8+
Gpio getRunningLedPin() {
9+
return Gpio::Unassigned;
10+
}
11+
12+
Gpio getWarningLedPin() {
13+
return Gpio::Unassigned;
14+
}
15+
16+
void setup_custom_board_overrides() {
17+
18+
}

0 commit comments

Comments
 (0)