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: Get all official build targets
26 run: echo "targets=$(make targets-ci-print | jq -R -c 'split(" ")')" >> $GITHUB_OUTPUT
27 - name: Cache build toolchain
28 uses: actions/cache@v3
32 key: ${{ runner.os }}-${{ hashFiles('make/tools.mk') }}
34 - name: Download and install toolchain
35 if: steps.cache-toolchain.outputs.cache-hit != 'true'
36 run: make arm_sdk_install
44 target: ${{ fromJson(needs.setup.outputs.targets) }}
47 uses: actions/checkout@v3
49 - name: Fetch toolchain from cache
50 uses: actions/cache@v3
54 key: ${{ runner.os }}-${{ hashFiles('make/tools.mk') }}
56 - name: Build target (without revision)
57 if: inputs.release_build == true
58 run: make EXTRA_FLAGS=-Werror ${{ matrix.target }}
60 - name: Build target (with revision)
61 if: inputs.release_build == false
62 run: make EXTRA_FLAGS=-Werror ${{ matrix.target }}_rev
64 - name: Publish build artifacts
65 uses: actions/upload-artifact@v3
75 - uses: actions/checkout@v3
77 - name: Install dependencies
78 run: sudo apt-get install -y libblocksruntime-dev
80 - name: Run sanity checks
81 run: make EXTRA_FLAGS=-Werror checks
83 - name: Run all unit tests
84 run: make EXTRA_FLAGS=-Werror test-all
92 - name: Check build matrix result
93 if: ${{ needs.build.result != 'success' }}
96 - name: Check test result
97 if: ${{ needs.test.result != 'success' }}