workflow integration - test
AVR Build / build (push) Has been cancelled

This commit is contained in:
Lukas
2026-04-29 11:04:12 +02:00
parent 4986f53d8a
commit d9f1e3e84c
2 changed files with 50 additions and 38 deletions
+50
View File
@@ -0,0 +1,50 @@
name: AVR Build
on:
push:
branches:
- dev
- live
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install AVR toolchain
run: |
apt-get update
apt-get install -y gcc-avr avr-libc binutils-avr make cppcheck
- name: Set build type from branch
id: vars
run: |
BRANCH="${GITHUB_REF_NAME}"
if [ "$BRANCH" = "dev" ]; then
echo "BUILD_TYPE=dev" >> $GITHUB_ENV
echo "PREFIX=DEV_ENO" >> $GITHUB_ENV
else
echo "BUILD_TYPE=live" >> $GITHUB_ENV
echo "PREFIX=ENO" >> $GITHUB_ENV
fi
echo "VERSION=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Code check
run: cppcheck --enable=all --error-exitcode=1 src/
- name: Build firmware
run: |
make BUILD_TYPE=$BUILD_TYPE PREFIX=$PREFIX VERSION=$VERSION
- name: Upload hex
uses: actions/upload-artifact@v4
with:
name: firmware-${{ env.BUILD_TYPE }}
path: build/**/*.hex
-38
View File
@@ -1,38 +0,0 @@
stages:
- build
variables:
F_CPU: "8000000UL"
before_script:
# nur nötig bei Shell Runner → Tools müssen installiert sein
- avr-gcc --version
build_dev:
stage: build
tags:
- avr
script:
- VERSION=$(cat VERSION.txt)
- echo "Building version $VERSION"
- make MCU=atmega644pa BUILD_TYPE=dev VERSION=$VERSION
artifacts:
paths:
- build/dev/*.hex
rules:
- if: '$CI_COMMIT_BRANCH == "dev"'
build_prod:
stage: build
tags:
- avr
script:
- VERSION=$(cat VERSION.txt)
- echo "Building DEV-Version $VERSION"
- make MCU=atmega644pa BUILD_TYPE=prod VERSION=$VERSION
artifacts:
paths:
- build/prod/*.hex
rules:
- if: '$CI_COMMIT_BRANCH == "main"'