mirror of
https://github.com/ClaytonWWilson/miryoku_zmk.git
synced 2025-12-17 02:58:47 +00:00
Add debug mode and more error messages to workflows
This commit is contained in:
parent
4620b91542
commit
d44283d90f
@ -6,5 +6,6 @@ on: workflow_dispatch
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '["corne-ish_zen_left","corne-ish_zen_right"]'
|
board: '["corne-ish_zen_left","corne-ish_zen_right"]'
|
||||||
|
|||||||
@ -6,6 +6,7 @@ on: workflow_dispatch
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '["nice_nano"]'
|
board: '["nice_nano"]'
|
||||||
shield: '["corne_left","corne_right"]'
|
shield: '["corne_left","corne_right"]'
|
||||||
|
|||||||
@ -6,6 +6,7 @@ on: workflow_dispatch
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '["nice_nano"]'
|
board: '["nice_nano"]'
|
||||||
shield: '["corne_left"]'
|
shield: '["corne_left"]'
|
||||||
|
|||||||
@ -6,6 +6,7 @@ on: workflow_dispatch
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '["nice_nano_v2"]'
|
board: '["nice_nano_v2"]'
|
||||||
shield: '["tbkmini_left","tbkmini_right"]'
|
shield: '["tbkmini_left","tbkmini_right"]'
|
||||||
|
|||||||
1
.github/workflows/build-inputs.yml
vendored
1
.github/workflows/build-inputs.yml
vendored
@ -79,6 +79,7 @@ jobs:
|
|||||||
set-output "branches" "${{ github.event.inputs.branches }}"
|
set-output "branches" "${{ github.event.inputs.branches }}"
|
||||||
build:
|
build:
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
needs: process-inputs
|
needs: process-inputs
|
||||||
with:
|
with:
|
||||||
board: ${{ needs.process-inputs.outputs.board }}
|
board: ${{ needs.process-inputs.outputs.board }}
|
||||||
|
|||||||
57
.github/workflows/main.yml
vendored
57
.github/workflows/main.yml
vendored
@ -54,6 +54,8 @@ jobs:
|
|||||||
custom_config: ${{ fromJSON(inputs.custom_config) }}
|
custom_config: ${{ fromJSON(inputs.custom_config) }}
|
||||||
kconfig: ${{ fromJSON(inputs.kconfig) }}
|
kconfig: ${{ fromJSON(inputs.kconfig) }}
|
||||||
branches: ${{ fromJSON(inputs.branches) }}
|
branches: ${{ fromJSON(inputs.branches) }}
|
||||||
|
env:
|
||||||
|
MIRYOKU_DEBUG: ${{ secrets.MIRYOKU_DEBUG }}
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@ -62,6 +64,8 @@ jobs:
|
|||||||
- name: main
|
- name: main
|
||||||
id: variables
|
id: variables
|
||||||
run: |
|
run: |
|
||||||
|
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && set -x
|
||||||
|
|
||||||
echo "::group::variables"
|
echo "::group::variables"
|
||||||
|
|
||||||
if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ]
|
if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ]
|
||||||
@ -110,15 +114,15 @@ jobs:
|
|||||||
echo "::set-output name=artifact-dir::$artifacts_dir"
|
echo "::set-output name=artifact-dir::$artifacts_dir"
|
||||||
mkdir "$artifacts_dir"
|
mkdir "$artifacts_dir"
|
||||||
|
|
||||||
cp "$configfile" "$artifacts_dir"
|
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && cp "$configfile" "$artifacts_dir"
|
||||||
|
|
||||||
if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ]
|
if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ]
|
||||||
then
|
then
|
||||||
kconfig_file="${GITHUB_WORKSPACE}/miryoku_zmk/config/$keyboard_split.conf"
|
kconfig_file="${GITHUB_WORKSPACE}/miryoku_zmk/config/$keyboard_split.conf"
|
||||||
echo "${{ matrix.kconfig }}" >> "$kconfig_file"
|
echo "${{ matrix.kconfig }}" >> "$kconfig_file"
|
||||||
cp "$kconfig_file" "$artifacts_dir"
|
|
||||||
artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1`
|
artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1`
|
||||||
fi
|
fi
|
||||||
|
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && test -f "$kconfig_file" && cp "$kconfig_file" "$artifacts_dir"
|
||||||
|
|
||||||
. "${GITHUB_WORKSPACE}/miryoku_zmk/.github/workflows/zmk"
|
. "${GITHUB_WORKSPACE}/miryoku_zmk/.github/workflows/zmk"
|
||||||
|
|
||||||
@ -136,7 +140,7 @@ jobs:
|
|||||||
outboard_file="${GITHUB_WORKSPACE}/miryoku_zmk/.github/workflows/outboards/$outboard"
|
outboard_file="${GITHUB_WORKSPACE}/miryoku_zmk/.github/workflows/outboards/$outboard"
|
||||||
if [ -f "$outboard_file" ]
|
if [ -f "$outboard_file" ]
|
||||||
then
|
then
|
||||||
cp "$outboard_file" "$artifacts_dir"
|
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && cp "$outboard_file" "$artifacts_dir"
|
||||||
. "$outboard_file"
|
. "$outboard_file"
|
||||||
outboard_dir="${GITHUB_WORKSPACE}/outboards/$outboard"
|
outboard_dir="${GITHUB_WORKSPACE}/outboards/$outboard"
|
||||||
if [ -n "$outboard_repository" -a -n "$outboard_ref" ]
|
if [ -n "$outboard_repository" -a -n "$outboard_ref" ]
|
||||||
@ -208,42 +212,67 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
|
if [ "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' ]
|
||||||
|
then
|
||||||
|
set -x
|
||||||
|
#west_debug='-v'
|
||||||
|
#west_build_debug='-t rom_report -t ram_report'
|
||||||
|
fi
|
||||||
|
|
||||||
echo "::group::setup"
|
echo "::group::setup"
|
||||||
cd "${GITHUB_WORKSPACE}/zmk"
|
cd "${GITHUB_WORKSPACE}/zmk"
|
||||||
west init -l app
|
west $west_debug init -l app
|
||||||
west update
|
west $west_debug update
|
||||||
west zephyr-export
|
west $west_debug zephyr-export
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
echo "::group::build"
|
echo "::group::build"
|
||||||
log='build.log'
|
log='build.log'
|
||||||
message='::error::Build failed with exit code'
|
build_failed_message='::error::Build failed with exit code'
|
||||||
EX_UNAVAILABLE='69'
|
EX_UNAVAILABLE='69'
|
||||||
|
EX_DATAERR='65'
|
||||||
cd "${GITHUB_WORKSPACE}/zmk/app"
|
cd "${GITHUB_WORKSPACE}/zmk/app"
|
||||||
{
|
{
|
||||||
west build -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/miryoku_zmk/config" ||
|
west $west_debug build -b ${{ matrix.board }} $west_build_debug -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/miryoku_zmk/config" ||
|
||||||
echo "$message $?." ;
|
echo "$build_failed_message $?." ;
|
||||||
} 2>&1 | tee "$log"
|
} 2>&1 | tee "$log"
|
||||||
if grep -q "$message" "$log"
|
if grep -q 'Invalid BOARD; see above.' "$log"
|
||||||
then
|
then
|
||||||
false
|
echo '::error::Board not found. Unsupported or incorrect board.'
|
||||||
|
(exit "$EX_UNAVAILABLE")
|
||||||
|
fi
|
||||||
|
if grep -q 'Failed to locate keymap file!' "$log"
|
||||||
|
then
|
||||||
|
echo '::error::Keymap not found. Unsupported or incorrect keyboard.'
|
||||||
|
(exit "$EX_UNAVAILABLE")
|
||||||
|
fi
|
||||||
|
if grep -q 'Invalid SHIELD' "$log"
|
||||||
|
then
|
||||||
|
echo '::error::Keymap found but shield not found. Board used for shield.'
|
||||||
|
(exit "$EX_DATAERR")
|
||||||
fi
|
fi
|
||||||
if ! grep -q 'Using keymap file: .*/config/[^/]*.keymap$' "$log"
|
if ! grep -q 'Using keymap file: .*/config/[^/]*.keymap$' "$log"
|
||||||
then
|
then
|
||||||
echo '::error::Miryoku keyboard keymap not found.'
|
echo '::error::Miryoku keyboard keymap not found. Unsupported or incorrect keyboard.'
|
||||||
exit "$EX_UNAVAILABLE"
|
(exit "$EX_UNAVAILABLE")
|
||||||
|
fi
|
||||||
|
if grep -q "$build_failed_message" "$log"
|
||||||
|
then
|
||||||
|
false
|
||||||
fi
|
fi
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
echo "::group::copy"
|
echo "::group::copy"
|
||||||
for extension in "uf2"
|
for extension in 'uf2' 'bin' 'hex'
|
||||||
do
|
do
|
||||||
file="${GITHUB_WORKSPACE}/zmk/app/build/zephyr/zmk.$extension"
|
file="${GITHUB_WORKSPACE}/zmk/app/build/zephyr/zmk.$extension"
|
||||||
if [ -f "$file" ]
|
if [ -f "$file" ]
|
||||||
then
|
then
|
||||||
cp "$file" "${{ steps.variables.outputs.artifact-dir }}/${{ steps.variables.outputs.artifact-build-name }}.$extension"
|
cp "$file" "${{ steps.variables.outputs.artifact-dir }}/${{ steps.variables.outputs.artifact-build-name }}.$extension"
|
||||||
|
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' || break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
test "$MIRYOKU_DEBUG" = 'MIRYOKU_DEBUG_TRUE' && cp "${GITHUB_WORKSPACE}/zmk/app/build/zephyr/.config" "${{ steps.variables.outputs.artifact-dir }}"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
- name: upload
|
- name: upload
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|||||||
1
.github/workflows/test-all-boards.yml
vendored
1
.github/workflows/test-all-boards.yml
vendored
@ -7,6 +7,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'manna-harbour'
|
if: github.repository_owner == 'manna-harbour'
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '[
|
board: '[
|
||||||
"adv360_left","adv360_right",
|
"adv360_left","adv360_right",
|
||||||
|
|||||||
1
.github/workflows/test-all-configs.yml
vendored
1
.github/workflows/test-all-configs.yml
vendored
@ -7,6 +7,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'manna-harbour'
|
if: github.repository_owner == 'manna-harbour'
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '["nice_nano"]'
|
board: '["nice_nano"]'
|
||||||
shield: '["corne_left"]'
|
shield: '["corne_left"]'
|
||||||
|
|||||||
@ -7,6 +7,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'manna-harbour'
|
if: github.repository_owner == 'manna-harbour'
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '[
|
board: '[
|
||||||
"bluemicro840_v1",
|
"bluemicro840_v1",
|
||||||
|
|||||||
@ -7,6 +7,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'manna-harbour'
|
if: github.repository_owner == 'manna-harbour'
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '["nice_nano_v2"]'
|
board: '["nice_nano_v2"]'
|
||||||
shield: '[
|
shield: '[
|
||||||
|
|||||||
@ -7,6 +7,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'manna-harbour'
|
if: github.repository_owner == 'manna-harbour'
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '[
|
board: '[
|
||||||
"seeeduino_xiao",
|
"seeeduino_xiao",
|
||||||
|
|||||||
1
.github/workflows/test-all-xiao-shields.yml
vendored
1
.github/workflows/test-all-xiao-shields.yml
vendored
@ -7,6 +7,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'manna-harbour'
|
if: github.repository_owner == 'manna-harbour'
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '["seeeduino_xiao"]'
|
board: '["seeeduino_xiao"]'
|
||||||
shield: '[
|
shield: '[
|
||||||
|
|||||||
1
.github/workflows/test-build.yml
vendored
1
.github/workflows/test-build.yml
vendored
@ -10,6 +10,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
if: github.repository_owner == 'manna-harbour'
|
if: github.repository_owner == 'manna-harbour'
|
||||||
uses: ./.github/workflows/main.yml
|
uses: ./.github/workflows/main.yml
|
||||||
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
board: '["nice_nano"]'
|
board: '["nice_nano"]'
|
||||||
shield: '["corne_left"]'
|
shield: '["corne_left"]'
|
||||||
|
|||||||
@ -44,6 +44,8 @@ See the [[docs/quickstart][Miryoku ZMK Quickstart Guide]] for step by step instr
|
|||||||
|
|
||||||
Workflow files are in [[.github/workflows]].
|
Workflow files are in [[.github/workflows]].
|
||||||
|
|
||||||
|
To enable Miryoku ZMK workflow debugging, set the following [[https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository][secret]] in the repository: ~MIRYOKU_DEBUG~ to ~MIRYOKU_DEBUG_TRUE~. Optionally also [[https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging][enable step debugging]].
|
||||||
|
|
||||||
|
|
||||||
**** Build Examples
|
**** Build Examples
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user