Skip to content

Commit

Permalink
update to current actions config
Browse files Browse the repository at this point in the history
  • Loading branch information
halcyonCorsair committed Jul 27, 2024
1 parent 7cca394 commit 29af68a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 115 deletions.
96 changes: 1 addition & 95 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,5 @@
on: [push, pull_request, workflow_dispatch]

name: Build

jobs:
matrix:
runs-on: ubuntu-latest
name: Fetch Build Keyboards
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install yaml2json
run: python3 -m pip install remarshal
- id: set-matrix
name: Fetch Build Matrix
run: |
matrix=$(yaml2json build.yaml | jq -c .)
yaml2json build.yaml
echo "::set-output name=matrix::${matrix}"
build:
runs-on: ubuntu-latest
container:
image: zmkfirmware/zmk-build-arm:stable
needs: matrix
name: Build
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
steps:
- name: Prepare variables
id: variables
run: |
if [ -n "${{ matrix.shield }}" ]; then
EXTRA_CMAKE_ARGS="-DSHIELD=${{ matrix.shield }}"
if [ -n "${{ matrix.keymap-name }}" ]; then
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.keymap-name }}-${{ matrix.board }}-zmk"
else
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
fi
DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}"
else
EXTRA_CMAKE_ARGS=
DISPLAY_NAME="${{ matrix.board }}"
ARTIFACT_NAME="${{ matrix.board }}-zmk"
fi
echo ::set-output name=extra-cmake-args::${EXTRA_CMAKE_ARGS}
echo ::set-output name=artifact-name::${ARTIFACT_NAME}
echo ::set-output name=display-name::${DISPLAY_NAME}
- name: Checkout
uses: actions/checkout@v2
- name: Cache west modules
uses: actions/cache@v2
env:
cache-name: cache-zephyr-modules
with:
path: |
modules/
tools/
zephyr/
bootloader/
zmk/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('manifest-dir/west.yml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- 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 (${{ steps.variables.outputs.display-name }})
run: |
west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }}
- name: ${{ steps.variables.outputs.display-name }} DTS File
if: ${{ always() }}
run: |
if [ -f "build/zephyr/${{ matrix.board }}.dts.pre.tmp" ]; then cat -n build/zephyr/${{ matrix.board }}.dts.pre.tmp; fi
if [ -f "build/zephyr/zephyr.dts" ]; then cat -n build/zephyr/zephyr.dts; fi
- name: ${{ steps.variables.outputs.display-name }} Kconfig file
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
- name: Rename artifacts
run: |
mkdir build/artifacts
if [ -f build/zephyr/zmk.uf2 ]
then
cp build/zephyr/zmk.uf2 "build/artifacts/${{ steps.variables.outputs.artifact-name }}.uf2"
elif [ -f build/zephyr/zmk.hex ]
then
cp build/zephyr/zmk.hex "build/artifacts/${{ steps.variables.outputs.artifact-name }}.hex"
fi
- name: Archive (${{ steps.variables.outputs.display-name }})
uses: actions/upload-artifact@v2
with:
name: firmware
path: build/artifacts
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main
31 changes: 14 additions & 17 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
# This file generates the GitHub Actions matrix
# For simple board + shield combinations, add them
# to the top level board and shield arrays, for more
# control, add individual board + shield combinations to
# the `include` property, e.g:
# This file generates the GitHub Actions matrix.
# For simple board + shield combinations, add them to the top level board and
# shield arrays, for more control, add individual board + shield combinations
# to the `include` property. You can also use the `cmake-args` property to
# pass flags to the build command and `artifact-name` to assign a name to
# distinguish build outputs from each other:
#
# board: [ "nice_nano_v2" ]
# shield: [ "corne_left", "corne_right" ]
# include:
# - board: bdn9_rev2
# - board: nice_nano_v2
# shield: reviung41
# - board: nice_nano_v2
# shield: corne_left
# cmake-args: -DCONFIG_ZMK_USB_LOGGING=y
# artifact-name: corne_left_with_logging
#
---
include:
# - board: "nice_nano_v2"
# shield: "kyria_rev2_left"
# cmake-args: "-DKEYMAP_FILE=${GITHUB_WORKSPACE}/config/kyria_rev2.keymap"
# keymap-name: "rev2_left"
# - board: "nice_nano_v2"
# shield: "kyria_rev2_right"
# cmake-args: "-DKEYMAP_FILE=${GITHUB_WORKSPACE}/config/kyria_rev2.keymap"
# keymap-name: "rev2_right"
- board: "nice_nano_v2"
shield: "cradio_left"
- board: "nice_nano_v2"
shield: "cradio_right"
- board: nice_nano_v2
shield: cradio_left
- board: nice_nano_v2
shield: cradio_right
5 changes: 2 additions & 3 deletions config/cradio.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#CONFIG_ZMK_USB_LOGGING=y
CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=6
CONFIG_ZMK_SLEEP=y

CONFIG_ZMK_COMBO_MAX_PRESSED_COMBOS=5
CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=12
CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=6

# Default: 5
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=3
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=5
# Default: 5
CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=8
CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=7
2 changes: 2 additions & 0 deletions config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
# Additional modules containing boards/shields/custom code can be listed here as well
# See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects
projects:
- name: zmk
remote: zmkfirmware
Expand Down

0 comments on commit 29af68a

Please sign in to comment.