1 # Builds Betaflight Firmware.
10 description: 'Specifies if it is a build that should include commit hash in hex file names or not'
20 targets: ${{ steps.get-targets.outputs.targets }}
22 - uses: actions/checkout@v3
24 - name: Cache build toolchain
25 uses: actions/cache@v3
29 key: ${{ runner.os }}-${{ hashFiles('mk/tools.mk') }}
31 - name: Download and install toolchain
32 if: steps.cache-toolchain.outputs.cache-hit != 'true'
33 run: make arm_sdk_install
35 - name: Hydrate configuration
39 - name: Get all official build targets
41 run: echo "targets=$(make targets-ci-print | jq -R -c 'split(" ")')" >> $GITHUB_OUTPUT
49 target: ${{ fromJson(needs.setup.outputs.targets) }}
52 uses: actions/checkout@v3
54 - name: Fetch toolchain from cache
55 uses: actions/cache@v3
59 key: ${{ runner.os }}-${{ hashFiles('mk/tools.mk') }}
61 - name: Hydrate configuration
65 - name: Build target (without revision)
66 if: inputs.release_build == true
67 run: make EXTRA_FLAGS=-Werror ${{ matrix.target }}
69 - name: Build target (with revision)
70 if: inputs.release_build == false
71 run: make EXTRA_FLAGS=-Werror ${{ matrix.target }}_rev
73 - name: Publish build artifacts
74 uses: actions/upload-artifact@v3
84 - uses: actions/checkout@v3
86 - name: Install dependencies
87 run: sudo apt-get install -y libblocksruntime-dev clang-12
89 - name: Run sanity checks
90 run: make EXTRA_FLAGS=-Werror checks
92 - name: Run all unit tests
93 run: make EXTRA_FLAGS=-Werror test-all
101 - name: Check build matrix result
102 if: ${{ needs.build.result != 'success' }}
105 - name: Check test result
106 if: ${{ needs.test.result != 'success' }}