1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 07:15:18 +03:00

- Adding nightly build at 1am UTC

- Updating cache for tool chain
- Using 10.3 as the build chain, due to bug in 11.2 -> https://bugs.linaro.org/show_bug.cgi?id=5825.
- No inlining to prevent over flow. Perhaps other calls represent better choices.
This commit is contained in:
blckmn 2022-07-11 17:18:43 +10:00
parent 005299f085
commit bc0fc26479
7 changed files with 91 additions and 18 deletions

View file

@ -7,7 +7,7 @@ on:
jobs: jobs:
artifacts-url-comments: artifacts-url-comments:
name: Add artifact links to PR and issues name: Add artifact links to PR and issues
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- name: Add artifact links to PR and issues - name: Add artifact links to PR and issues
uses: tonyhallett/artifacts-url-comments@v1.1.0 uses: tonyhallett/artifacts-url-comments@v1.1.0

View file

@ -26,10 +26,10 @@ jobs:
run: echo "::set-output name=targets::$(make targets-ci-print | jq -R -c 'split(" ")')" run: echo "::set-output name=targets::$(make targets-ci-print | jq -R -c 'split(" ")')"
- name: Cache build toolchain - name: Cache build toolchain
uses: actions/cache@v2 uses: actions/cache@v3
id: cache-toolchain id: cache-toolchain
with: with:
path: tools/ path: tools
key: ${{ runner.os }}-${{ hashFiles('make/tools.mk') }} key: ${{ runner.os }}-${{ hashFiles('make/tools.mk') }}
- name: Download and install toolchain - name: Download and install toolchain
@ -39,7 +39,7 @@ jobs:
build: build:
name: Build name: Build
needs: setup needs: setup
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
target: ${{ fromJson(needs.setup.outputs.targets) }} target: ${{ fromJson(needs.setup.outputs.targets) }}
@ -48,10 +48,10 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Fetch toolchain from cache - name: Fetch toolchain from cache
uses: actions/cache@v2 uses: actions/cache@v3
id: cache-toolchain id: cache-toolchain
with: with:
path: tools/ path: tools
key: ${{ runner.os }}-${{ hashFiles('make/tools.mk') }} key: ${{ runner.os }}-${{ hashFiles('make/tools.mk') }}
- name: Build target (without revision) - name: Build target (without revision)

View file

@ -7,7 +7,7 @@ on:
jobs: jobs:
hide-artifacts-link-comments: hide-artifacts-link-comments:
name: Hide artifact links name: Hide artifact links
runs-on: ubuntu-20.04 runs-on: ubuntu-22.04
steps: steps:
- name: Hide comments - name: Hide comments
uses: int128/hide-comment-action@v1 uses: int128/hide-comment-action@v1

71
.github/workflows/nightly.yml vendored Normal file
View file

@ -0,0 +1,71 @@
# You'll need to setup the follwing environment variables:
# env.repo_nightly - The repository to release nightly builds to e.g. betaflight-nightly
# env.release_notes - The release notes to be published as part of the github release
# env.debug_release_notes - The release notes to be published as part of the github debug release
# secrets.REPO_TOKEN - A GitHub token with permissions to push and publish releases to the nightly repo
env:
repo_nightly: betaflight/betaflight-nightlies
debug_release_notes: >
This is an automated development build.
It may be unstable and result in craft loss or damage.
**Use only for testing.**
release_notes: This is a release build.
name: Nightly
on:
schedule:
- cron: "0 1 * * *"
jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
with:
release_build: false
release:
name: Nightly release
needs: ci
runs-on: ubuntu-22.04
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v2
with:
path: assets/
- name: Select release notes
id: notes
run: |
set -- assets/*.hex
echo "::set-output name=notes::$(test -e "$1" && echo '${{ env.debug_release_notes }}' || echo '${{ env.release_notes }}')"
- name: Get current date
id: date
run: echo "::set-output name=today::$(date '+%Y%m%d')"
- name: Release
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v0.1.14
with:
token: ${{ secrets.REPO_TOKEN }}
repository: ${{ env.repo_nightly }}
tag_name: v${{ steps.date.outputs.today }}.${{ github.run_number }}
files: assets/*.hex
draft: false
prerelease: false
fail_on_unmatched_files: true
body: |
${{ steps.notes.outputs.notes }}
### Repository:
${{ github.repository }} ([link](${{ github.event.repository.html_url }}))
### Branch:
${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
### Latest changeset:
${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))
### Changes:
${{ github.event.head_commit.message }}

View file

@ -5,6 +5,8 @@
# NOTE: These are not tied to the default goals # NOTE: These are not tied to the default goals
# and must be invoked manually # and must be invoked manually
# #
# ARM SDK Version: 10.3-2021.10
#
############################################################### ###############################################################
############################## ##############################
@ -14,9 +16,9 @@
############################## ##############################
# Set up ARM (STM32) SDK # Set up ARM (STM32) SDK
ARM_SDK_DIR ?= $(TOOLS_DIR)/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi ARM_SDK_DIR ?= $(TOOLS_DIR)/gcc-arm-none-eabi-10.3-2021.10
# Checked below, Should match the output of $(shell arm-none-eabi-gcc -dumpversion) # Checked below, Should match the output of $(shell arm-none-eabi-gcc -dumpversion)
GCC_REQUIRED_VERSION ?= 11.2 GCC_REQUIRED_VERSION ?= 10.3
.PHONY: arm_sdk_version .PHONY: arm_sdk_version
@ -26,18 +28,18 @@ arm_sdk_version:
## arm_sdk_install : Install Arm SDK ## arm_sdk_install : Install Arm SDK
.PHONY: arm_sdk_install .PHONY: arm_sdk_install
# source: https://developer.arm.com/downloads/-/gnu-rm ARM_SDK_URL_BASE := https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10
# source: https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads
ifeq ($(OSFAMILY), linux) ifeq ($(OSFAMILY), linux)
ARM_SDK_URL := https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi.tar.xz ARM_SDK_URL := $(ARM_SDK_URL_BASE)-x86_64-linux.tar.bz2
endif endif
ifeq ($(OSFAMILY), macosx) ifeq ($(OSFAMILY), macosx)
ARM_SDK_URL := https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-darwin-x86_64-arm-none-eabi.tar.xz ARM_SDK_URL := $(ARM_SDK_URL_BASE)-mac.tar.bz2
endif endif
ifeq ($(OSFAMILY), windows) ifeq ($(OSFAMILY), windows)
ARM_SDK_URL := https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-mingw-w64-i686-arm-none-eabi.zip ARM_SDK_URL := $(ARM_SDK_URL_BASE)-win32.zip
endif endif
ARM_SDK_FILE := $(notdir $(ARM_SDK_URL)) ARM_SDK_FILE := $(notdir $(ARM_SDK_URL))
@ -52,7 +54,7 @@ arm_sdk_install: arm_sdk_download $(SDK_INSTALL_MARKER)
$(SDK_INSTALL_MARKER): $(SDK_INSTALL_MARKER):
ifneq ($(OSFAMILY), windows) ifneq ($(OSFAMILY), windows)
# binary only release so just extract it # binary only release so just extract it
$(V1) tar -C $(TOOLS_DIR) -xf "$(DL_DIR)/$(ARM_SDK_FILE)" $(V1) tar -C $(TOOLS_DIR) -xjf "$(DL_DIR)/$(ARM_SDK_FILE)"
else else
$(V1) unzip -q -d $(ARM_SDK_DIR) "$(DL_DIR)/$(ARM_SDK_FILE)" $(V1) unzip -q -d $(ARM_SDK_DIR) "$(DL_DIR)/$(ARM_SDK_FILE)"
endif endif

View file

@ -1082,7 +1082,7 @@ void processRxModes(timeUs_t currentTimeUs)
pidSetAntiGravityState(IS_RC_MODE_ACTIVE(BOXANTIGRAVITY) || featureIsEnabled(FEATURE_ANTI_GRAVITY)); pidSetAntiGravityState(IS_RC_MODE_ACTIVE(BOXANTIGRAVITY) || featureIsEnabled(FEATURE_ANTI_GRAVITY));
} }
static FAST_CODE void subTaskPidController(timeUs_t currentTimeUs) static FAST_CODE_NOINLINE void subTaskPidController(timeUs_t currentTimeUs)
{ {
uint32_t startTime = 0; uint32_t startTime = 0;
if (debugMode == DEBUG_PIDLOOP) {startTime = micros();} if (debugMode == DEBUG_PIDLOOP) {startTime = micros();}

View file

@ -291,7 +291,7 @@ static FAST_CODE_NOINLINE void handleOverflow(timeUs_t currentTimeUs)
} }
} }
static FAST_CODE void checkForOverflow(timeUs_t currentTimeUs) static FAST_CODE_NOINLINE void checkForOverflow(timeUs_t currentTimeUs)
{ {
// check for overflow to handle Yaw Spin To The Moon (YSTTM) // check for overflow to handle Yaw Spin To The Moon (YSTTM)
// ICM gyros are specified to +/- 2000 deg/sec, in a crash they can go out of spec. // ICM gyros are specified to +/- 2000 deg/sec, in a crash they can go out of spec.
@ -346,7 +346,7 @@ static FAST_CODE_NOINLINE void handleYawSpin(timeUs_t currentTimeUs)
} }
} }
static FAST_CODE void checkForYawSpin(timeUs_t currentTimeUs) static FAST_CODE_NOINLINE void checkForYawSpin(timeUs_t currentTimeUs)
{ {
// if not in overflow mode, handle yaw spins above threshold // if not in overflow mode, handle yaw spins above threshold
#ifdef USE_GYRO_OVERFLOW_CHECK #ifdef USE_GYRO_OVERFLOW_CHECK