zmk-config/.gitea/workflows/build.yaml

92 lines
2.8 KiB
YAML
Raw Normal View History

2024-08-16 10:23:29 +00:00
on:
2024-08-15 07:21:17 +00:00
push:
branches:
- main
2024-08-15 06:49:07 +00:00
2024-08-16 10:23:29 +00:00
name: Build
2024-08-09 17:20:17 +00:00
jobs:
2024-08-16 10:23:29 +00:00
build:
2024-08-15 06:49:07 +00:00
runs-on: ubuntu-latest
container:
2024-08-16 12:50:10 +00:00
image: git.kjan.de/actions/zmk-builder:latest
2024-08-16 10:23:29 +00:00
name: Build
2024-08-16 12:53:29 +00:00
steps:
2024-08-16 10:23:29 +00:00
- name: Checkout
2024-08-16 11:48:24 +00:00
uses: https://git.kjan.de/actions/checkout@v4
2024-08-16 10:23:29 +00:00
- name: Hash west modules
2024-08-15 06:59:00 +00:00
id: hash-west
run: |
2024-08-16 10:23:29 +00:00
FILE_PATH=zephyr/west.yml
FILES=$(find . -name build.yml -o -name west.yml -type f -exec sha256sum \; | sort)
HASH="$(echo -n $FILES | sha256sum | head -c 64)"
2024-08-15 06:59:00 +00:00
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
2024-08-16 10:23:29 +00:00
echo "computed hash: $HASH"
2024-08-15 06:49:07 +00:00
- name: Cache west modules
2024-08-16 11:48:24 +00:00
uses: https://git.kjan.de/actions/cache@v4
2024-08-16 10:23:29 +00:00
env:
cache-name: cache-zephyr-modules
2024-08-15 06:49:07 +00:00
with:
path: |
modules/
tools/
zephyr/
2024-08-16 10:23:29 +00:00
bootloader/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ steps.hash-west.outputs.hash }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
timeout-minutes: 5
continue-on-error: true
- name: West Init
run: west init -l config
- name: West Update
run: west update
- name: West Zephyr export
run: west zephyr-export
- name: West Build (Ferris Left)
2024-08-16 10:03:13 +00:00
run: west build -s zmk/app -b nice_nano_v2 -- -DSHIELD=cradio_left -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
2024-08-16 09:28:21 +00:00
2024-08-16 10:23:29 +00:00
- name: Ferris Left Kconfig file
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
- name: Rename zmk.uf2
run: cp build/zephyr/zmk.uf2 cradio_left_nice_nano_v2.uf2
- name: West Build (Ferris Right)
run: west build --pristine -s zmk/app -b nice_nano_v2 -- -DSHIELD=cradio_right -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
- name: Ferris Right Kconfig file
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
- name: Rename zmk.uf2
run: cp build/zephyr/zmk.uf2 cradio_right_nice_nano_v2.uf2
- name: Move artifacts
2024-08-16 09:28:21 +00:00
run: |
2024-08-16 10:23:29 +00:00
mkdir firmware
mv cradio_left_nice_nano_v2.uf2 firmware/
mv cradio_right_nice_nano_v2.uf2 firmware/
- name: Hash west modules
2024-08-16 09:28:21 +00:00
id: hash-west
run: |
2024-08-16 10:23:29 +00:00
FILE_PATH=zephyr/west.yml
FILES=$(find . -name build.yml -o -name west.yml -type f -exec sha256sum \; | sort)
HASH="$(echo -n $FILES | sha256sum | head -c 64)"
2024-08-16 09:28:21 +00:00
echo "hash=$HASH" >> "$GITHUB_OUTPUT"
2024-08-16 10:23:29 +00:00
echo "computed hash: $HASH"
2024-08-16 09:28:21 +00:00
2024-08-16 10:23:29 +00:00
- name: Upload Artifact
2024-08-16 11:48:24 +00:00
uses: https://git.kjan.de/actions/upload-artifact@v3
2024-08-15 06:49:07 +00:00
with:
2024-08-16 06:25:16 +00:00
path: firmware/
name: firmware