From 196a00c86f41d211d1a0d1a0468c487c74c6feb1 Mon Sep 17 00:00:00 2001 From: Manna Harbour <51143715+manna-harbour@users.noreply.github.com> Date: Sun, 22 Aug 2021 21:27:40 +1000 Subject: [PATCH] Add Kconfig field to matrix and inputs workflows - rename outboards files --- .../build-example-corne-nice_nano.yml | 34 +++++++++++----- .../build-example-tbkmini-nice_nano_v2.yml | 34 +++++++++++----- .github/workflows/build-inputs.yml | 39 ++++++++++++++----- .../outboards/{absolem => absolem.outboard} | 0 .../outboards/{ahokore => ahokore.outboard} | 0 .../outboards/{bastyl => bastyl.outboard} | 0 ...ardsource5x12 => boardsource5x12.outboard} | 0 .../outboards/{contra => contra.outboard} | 0 .../{corne-ish_zen => corne-ish_zen.outboard} | 0 .../outboards/{cradio36 => cradio36.outboard} | 0 .../outboards/{cradios => cradios.outboard} | 0 .../outboards/{ergodash => ergodash.outboard} | 0 .../{ferris_rev02 => ferris_rev02.outboard} | 0 .../outboards/{levinson => levinson.outboard} | 0 .../outboards/{naked60 => naked60.outboard} | 0 .../{pockettype => pockettype.outboard} | 0 .../{preonic_rev3 => preonic_rev3.outboard} | 0 .../outboards/{pteron36 => pteron36.outboard} | 0 .../{rebound_v4 => rebound_v4.outboard} | 0 .../{reviung39 => reviung39.outboard} | 0 .../outboards/{sweepv2 => sweepv2.outboard} | 0 .../outboards/{tbkmini => tbkmini.outboard} | 0 .../outboards/{viterbi => viterbi.outboard} | 0 .../outboards/{zaphod => zaphod.outboard} | 0 .../src/build-example-corne-nice_nano.yml.m4 | 2 + .../build-example-tbkmini-nice_nano_v2.yml.m4 | 2 + .github/workflows/src/build-inputs.yml.m4 | 7 ++++ .../workflows/src/include/build-steps.yml.m4 | 32 ++++++++++----- .github/workflows/src/test-boards.yml.m4 | 2 + .github/workflows/src/test-build.yml.m4 | 2 + .github/workflows/src/test-configs.yml.m4 | 2 + .github/workflows/src/test-controllers.yml.m4 | 2 + .github/workflows/src/test-shields.yml.m4 | 2 + .github/workflows/test-boards.yml | 34 +++++++++++----- .github/workflows/test-build.yml | 34 +++++++++++----- .github/workflows/test-configs.yml | 34 +++++++++++----- .github/workflows/test-controllers.yml | 34 +++++++++++----- .github/workflows/test-shields.yml | 34 +++++++++++----- readme.org | 18 +++++---- 39 files changed, 260 insertions(+), 88 deletions(-) rename .github/workflows/outboards/{absolem => absolem.outboard} (100%) rename .github/workflows/outboards/{ahokore => ahokore.outboard} (100%) rename .github/workflows/outboards/{bastyl => bastyl.outboard} (100%) rename .github/workflows/outboards/{boardsource5x12 => boardsource5x12.outboard} (100%) rename .github/workflows/outboards/{contra => contra.outboard} (100%) rename .github/workflows/outboards/{corne-ish_zen => corne-ish_zen.outboard} (100%) rename .github/workflows/outboards/{cradio36 => cradio36.outboard} (100%) rename .github/workflows/outboards/{cradios => cradios.outboard} (100%) rename .github/workflows/outboards/{ergodash => ergodash.outboard} (100%) rename .github/workflows/outboards/{ferris_rev02 => ferris_rev02.outboard} (100%) rename .github/workflows/outboards/{levinson => levinson.outboard} (100%) rename .github/workflows/outboards/{naked60 => naked60.outboard} (100%) rename .github/workflows/outboards/{pockettype => pockettype.outboard} (100%) rename .github/workflows/outboards/{preonic_rev3 => preonic_rev3.outboard} (100%) rename .github/workflows/outboards/{pteron36 => pteron36.outboard} (100%) rename .github/workflows/outboards/{rebound_v4 => rebound_v4.outboard} (100%) rename .github/workflows/outboards/{reviung39 => reviung39.outboard} (100%) rename .github/workflows/outboards/{sweepv2 => sweepv2.outboard} (100%) rename .github/workflows/outboards/{tbkmini => tbkmini.outboard} (100%) rename .github/workflows/outboards/{viterbi => viterbi.outboard} (100%) rename .github/workflows/outboards/{zaphod => zaphod.outboard} (100%) diff --git a/.github/workflows/build-example-corne-nice_nano.yml b/.github/workflows/build-example-corne-nice_nano.yml index 951f330..7f5de61 100644 --- a/.github/workflows/build-example-corne-nice_nano.yml +++ b/.github/workflows/build-example-corne-nice_nano.yml @@ -28,6 +28,8 @@ jobs: - default mapping: - default + kconfig: + - default steps: - name: Checkout uses: actions/checkout@v2 @@ -35,7 +37,6 @@ jobs: id: variables run: | if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ] - then SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" keyboard=${{ matrix.shield }} @@ -63,17 +64,34 @@ jobs: ;; esac done - artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` - echo "::set-output name=artifact-build-name::$artifact_build_name" - echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` - echo "::set-output name=artifact-dir::artifacts" - outboard_file=".github/workflows/outboards/$keyboard" + artifacts_dir="artifacts" + echo "::set-output name=artifact-dir::$artifacts_dir" + mkdir "$artifacts_dir" + cp "$configfile" "$artifacts_dir" + + if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] + then + kconfig_file="config/$keyboard.conf" + echo "${{ matrix.kconfig }}" > "$kconfig_file" + cat "$kconfig_file" + cp "$kconfig_file" "$artifacts_dir" + artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` + fi + + outboard_file=".github/workflows/outboards/$keyboard.outboard" if [ -f "$outboard_file" ] then grep -v '^#' "$outboard_file" >> $GITHUB_ENV + cat "$outboard_file" + cp "$outboard_file" "$artifacts_dir" fi echo "::set-output name=outboard_dir::outboard" + + artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` + echo "::set-output name=artifact-build-name::$artifact_build_name" + echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` + - name: Checkout outboard if: ${{ env.outboard_repository != '' && env.outboard_ref != '' }} uses: actions/checkout@v2 @@ -119,10 +137,8 @@ jobs: run: west zephyr-export - name: Build (west build) run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: Prepare artifacts + - name: Prepare firmware artifacts run: | - mkdir ${{ steps.variables.outputs.artifact-dir }} - cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" for extension in "hex" "uf2" do file="build/zephyr/zmk.$extension" diff --git a/.github/workflows/build-example-tbkmini-nice_nano_v2.yml b/.github/workflows/build-example-tbkmini-nice_nano_v2.yml index 8153791..f80e9b7 100644 --- a/.github/workflows/build-example-tbkmini-nice_nano_v2.yml +++ b/.github/workflows/build-example-tbkmini-nice_nano_v2.yml @@ -28,6 +28,8 @@ jobs: - default mapping: - default + kconfig: + - default steps: - name: Checkout uses: actions/checkout@v2 @@ -35,7 +37,6 @@ jobs: id: variables run: | if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ] - then SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" keyboard=${{ matrix.shield }} @@ -63,17 +64,34 @@ jobs: ;; esac done - artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` - echo "::set-output name=artifact-build-name::$artifact_build_name" - echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` - echo "::set-output name=artifact-dir::artifacts" - outboard_file=".github/workflows/outboards/$keyboard" + artifacts_dir="artifacts" + echo "::set-output name=artifact-dir::$artifacts_dir" + mkdir "$artifacts_dir" + cp "$configfile" "$artifacts_dir" + + if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] + then + kconfig_file="config/$keyboard.conf" + echo "${{ matrix.kconfig }}" > "$kconfig_file" + cat "$kconfig_file" + cp "$kconfig_file" "$artifacts_dir" + artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` + fi + + outboard_file=".github/workflows/outboards/$keyboard.outboard" if [ -f "$outboard_file" ] then grep -v '^#' "$outboard_file" >> $GITHUB_ENV + cat "$outboard_file" + cp "$outboard_file" "$artifacts_dir" fi echo "::set-output name=outboard_dir::outboard" + + artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` + echo "::set-output name=artifact-build-name::$artifact_build_name" + echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` + - name: Checkout outboard if: ${{ env.outboard_repository != '' && env.outboard_ref != '' }} uses: actions/checkout@v2 @@ -119,10 +137,8 @@ jobs: run: west zephyr-export - name: Build (west build) run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: Prepare artifacts + - name: Prepare firmware artifacts run: | - mkdir ${{ steps.variables.outputs.artifact-dir }} - cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" for extension in "hex" "uf2" do file="build/zephyr/zmk.$extension" diff --git a/.github/workflows/build-inputs.yml b/.github/workflows/build-inputs.yml index 75da018..1426a17 100644 --- a/.github/workflows/build-inputs.yml +++ b/.github/workflows/build-inputs.yml @@ -33,6 +33,10 @@ on: description: 'Miryoku Mapping' required: false default: 'default' + kconfig: + description: 'Kconfig' + required: false + default: 'default' jobs: process-inputs: runs-on: ubuntu-latest @@ -44,6 +48,7 @@ jobs: clipboard: ${{ steps.process-inputs.outputs.clipboard }} layers: ${{ steps.process-inputs.outputs.layers }} mapping: ${{ steps.process-inputs.outputs.mapping }} + kconfig: ${{ steps.process-inputs.outputs.kconfig }} steps: - name: Process inputs id: process-inputs @@ -60,6 +65,7 @@ jobs: set-output "clipboard" "${{ github.event.inputs.clipboard }}" set-output "layers" "${{ github.event.inputs.layers }}" set-output "mapping" "${{ github.event.inputs.mapping }}" + set-output "kconfig" "${{ github.event.inputs.kconfig }}" build: runs-on: ubuntu-latest container: @@ -75,6 +81,7 @@ jobs: clipboard: ${{ fromJSON(needs.process-inputs.outputs.clipboard) }} layers: ${{ fromJSON(needs.process-inputs.outputs.layers) }} mapping: ${{ fromJSON(needs.process-inputs.outputs.mapping) }} + kconfig: ${{ fromJSON(needs.process-inputs.outputs.kconfig) }} steps: - name: Checkout uses: actions/checkout@v2 @@ -82,7 +89,6 @@ jobs: id: variables run: | if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ] - then SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" keyboard=${{ matrix.shield }} @@ -110,17 +116,34 @@ jobs: ;; esac done - artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` - echo "::set-output name=artifact-build-name::$artifact_build_name" - echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` - echo "::set-output name=artifact-dir::artifacts" - outboard_file=".github/workflows/outboards/$keyboard" + artifacts_dir="artifacts" + echo "::set-output name=artifact-dir::$artifacts_dir" + mkdir "$artifacts_dir" + cp "$configfile" "$artifacts_dir" + + if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] + then + kconfig_file="config/$keyboard.conf" + echo "${{ matrix.kconfig }}" > "$kconfig_file" + cat "$kconfig_file" + cp "$kconfig_file" "$artifacts_dir" + artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` + fi + + outboard_file=".github/workflows/outboards/$keyboard.outboard" if [ -f "$outboard_file" ] then grep -v '^#' "$outboard_file" >> $GITHUB_ENV + cat "$outboard_file" + cp "$outboard_file" "$artifacts_dir" fi echo "::set-output name=outboard_dir::outboard" + + artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` + echo "::set-output name=artifact-build-name::$artifact_build_name" + echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` + - name: Checkout outboard if: ${{ env.outboard_repository != '' && env.outboard_ref != '' }} uses: actions/checkout@v2 @@ -166,10 +189,8 @@ jobs: run: west zephyr-export - name: Build (west build) run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: Prepare artifacts + - name: Prepare firmware artifacts run: | - mkdir ${{ steps.variables.outputs.artifact-dir }} - cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" for extension in "hex" "uf2" do file="build/zephyr/zmk.$extension" diff --git a/.github/workflows/outboards/absolem b/.github/workflows/outboards/absolem.outboard similarity index 100% rename from .github/workflows/outboards/absolem rename to .github/workflows/outboards/absolem.outboard diff --git a/.github/workflows/outboards/ahokore b/.github/workflows/outboards/ahokore.outboard similarity index 100% rename from .github/workflows/outboards/ahokore rename to .github/workflows/outboards/ahokore.outboard diff --git a/.github/workflows/outboards/bastyl b/.github/workflows/outboards/bastyl.outboard similarity index 100% rename from .github/workflows/outboards/bastyl rename to .github/workflows/outboards/bastyl.outboard diff --git a/.github/workflows/outboards/boardsource5x12 b/.github/workflows/outboards/boardsource5x12.outboard similarity index 100% rename from .github/workflows/outboards/boardsource5x12 rename to .github/workflows/outboards/boardsource5x12.outboard diff --git a/.github/workflows/outboards/contra b/.github/workflows/outboards/contra.outboard similarity index 100% rename from .github/workflows/outboards/contra rename to .github/workflows/outboards/contra.outboard diff --git a/.github/workflows/outboards/corne-ish_zen b/.github/workflows/outboards/corne-ish_zen.outboard similarity index 100% rename from .github/workflows/outboards/corne-ish_zen rename to .github/workflows/outboards/corne-ish_zen.outboard diff --git a/.github/workflows/outboards/cradio36 b/.github/workflows/outboards/cradio36.outboard similarity index 100% rename from .github/workflows/outboards/cradio36 rename to .github/workflows/outboards/cradio36.outboard diff --git a/.github/workflows/outboards/cradios b/.github/workflows/outboards/cradios.outboard similarity index 100% rename from .github/workflows/outboards/cradios rename to .github/workflows/outboards/cradios.outboard diff --git a/.github/workflows/outboards/ergodash b/.github/workflows/outboards/ergodash.outboard similarity index 100% rename from .github/workflows/outboards/ergodash rename to .github/workflows/outboards/ergodash.outboard diff --git a/.github/workflows/outboards/ferris_rev02 b/.github/workflows/outboards/ferris_rev02.outboard similarity index 100% rename from .github/workflows/outboards/ferris_rev02 rename to .github/workflows/outboards/ferris_rev02.outboard diff --git a/.github/workflows/outboards/levinson b/.github/workflows/outboards/levinson.outboard similarity index 100% rename from .github/workflows/outboards/levinson rename to .github/workflows/outboards/levinson.outboard diff --git a/.github/workflows/outboards/naked60 b/.github/workflows/outboards/naked60.outboard similarity index 100% rename from .github/workflows/outboards/naked60 rename to .github/workflows/outboards/naked60.outboard diff --git a/.github/workflows/outboards/pockettype b/.github/workflows/outboards/pockettype.outboard similarity index 100% rename from .github/workflows/outboards/pockettype rename to .github/workflows/outboards/pockettype.outboard diff --git a/.github/workflows/outboards/preonic_rev3 b/.github/workflows/outboards/preonic_rev3.outboard similarity index 100% rename from .github/workflows/outboards/preonic_rev3 rename to .github/workflows/outboards/preonic_rev3.outboard diff --git a/.github/workflows/outboards/pteron36 b/.github/workflows/outboards/pteron36.outboard similarity index 100% rename from .github/workflows/outboards/pteron36 rename to .github/workflows/outboards/pteron36.outboard diff --git a/.github/workflows/outboards/rebound_v4 b/.github/workflows/outboards/rebound_v4.outboard similarity index 100% rename from .github/workflows/outboards/rebound_v4 rename to .github/workflows/outboards/rebound_v4.outboard diff --git a/.github/workflows/outboards/reviung39 b/.github/workflows/outboards/reviung39.outboard similarity index 100% rename from .github/workflows/outboards/reviung39 rename to .github/workflows/outboards/reviung39.outboard diff --git a/.github/workflows/outboards/sweepv2 b/.github/workflows/outboards/sweepv2.outboard similarity index 100% rename from .github/workflows/outboards/sweepv2 rename to .github/workflows/outboards/sweepv2.outboard diff --git a/.github/workflows/outboards/tbkmini b/.github/workflows/outboards/tbkmini.outboard similarity index 100% rename from .github/workflows/outboards/tbkmini rename to .github/workflows/outboards/tbkmini.outboard diff --git a/.github/workflows/outboards/viterbi b/.github/workflows/outboards/viterbi.outboard similarity index 100% rename from .github/workflows/outboards/viterbi rename to .github/workflows/outboards/viterbi.outboard diff --git a/.github/workflows/outboards/zaphod b/.github/workflows/outboards/zaphod.outboard similarity index 100% rename from .github/workflows/outboards/zaphod rename to .github/workflows/outboards/zaphod.outboard diff --git a/.github/workflows/src/build-example-corne-nice_nano.yml.m4 b/.github/workflows/src/build-example-corne-nice_nano.yml.m4 index a8e32a9..27870c5 100644 --- a/.github/workflows/src/build-example-corne-nice_nano.yml.m4 +++ b/.github/workflows/src/build-example-corne-nice_nano.yml.m4 @@ -18,4 +18,6 @@ m4_include(include/jobs-build.yml.m4)m4_dnl - default mapping: - default + kconfig: + - default m4_include(include/build-steps.yml.m4)m4_dnl diff --git a/.github/workflows/src/build-example-tbkmini-nice_nano_v2.yml.m4 b/.github/workflows/src/build-example-tbkmini-nice_nano_v2.yml.m4 index bfd7fb6..b59fc0e 100644 --- a/.github/workflows/src/build-example-tbkmini-nice_nano_v2.yml.m4 +++ b/.github/workflows/src/build-example-tbkmini-nice_nano_v2.yml.m4 @@ -18,4 +18,6 @@ m4_include(include/jobs-build.yml.m4)m4_dnl - default mapping: - default + kconfig: + - default m4_include(include/build-steps.yml.m4)m4_dnl diff --git a/.github/workflows/src/build-inputs.yml.m4 b/.github/workflows/src/build-inputs.yml.m4 index d7eb866..86d6644 100644 --- a/.github/workflows/src/build-inputs.yml.m4 +++ b/.github/workflows/src/build-inputs.yml.m4 @@ -32,6 +32,10 @@ on: description: 'Miryoku Mapping' required: false default: 'default' + kconfig: + description: 'Kconfig' + required: false + default: 'default' jobs: process-inputs: runs-on: ubuntu-latest @@ -43,6 +47,7 @@ jobs: clipboard: ${{ steps.process-inputs.outputs.clipboard }} layers: ${{ steps.process-inputs.outputs.layers }} mapping: ${{ steps.process-inputs.outputs.mapping }} + kconfig: ${{ steps.process-inputs.outputs.kconfig }} steps: - name: Process inputs id: process-inputs @@ -59,6 +64,7 @@ jobs: set-output "clipboard" "${{ github.event.inputs.clipboard }}" set-output "layers" "${{ github.event.inputs.layers }}" set-output "mapping" "${{ github.event.inputs.mapping }}" + set-output "kconfig" "${{ github.event.inputs.kconfig }}" build: runs-on: ubuntu-latest container: @@ -74,4 +80,5 @@ jobs: clipboard: ${{ fromJSON(needs.process-inputs.outputs.clipboard) }} layers: ${{ fromJSON(needs.process-inputs.outputs.layers) }} mapping: ${{ fromJSON(needs.process-inputs.outputs.mapping) }} + kconfig: ${{ fromJSON(needs.process-inputs.outputs.kconfig) }} m4_include(include/build-steps.yml.m4)m4_dnl diff --git a/.github/workflows/src/include/build-steps.yml.m4 b/.github/workflows/src/include/build-steps.yml.m4 index 0f0af3d..f4d41c7 100644 --- a/.github/workflows/src/include/build-steps.yml.m4 +++ b/.github/workflows/src/include/build-steps.yml.m4 @@ -5,7 +5,6 @@ id: variables run: | if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ] - then SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" keyboard=${{ matrix.shield }} @@ -33,17 +32,34 @@ ;; esac done - artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` - echo "::set-output name=artifact-build-name::$artifact_build_name" - echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` - echo "::set-output name=artifact-dir::artifacts" - outboard_file=".github/workflows/outboards/$keyboard" + artifacts_dir="artifacts" + echo "::set-output name=artifact-dir::$artifacts_dir" + mkdir "$artifacts_dir" + cp "$configfile" "$artifacts_dir" + + if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] + then + kconfig_file="config/$keyboard.conf" + echo "${{ matrix.kconfig }}" > "$kconfig_file" + cat "$kconfig_file" + cp "$kconfig_file" "$artifacts_dir" + artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` + fi + + outboard_file=".github/workflows/outboards/$keyboard.outboard" if [ -f "$outboard_file" ] then grep -v '^#' "$outboard_file" >> $GITHUB_ENV + cat "$outboard_file" + cp "$outboard_file" "$artifacts_dir" fi echo "::set-output name=outboard_dir::outboard" + + artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` + echo "::set-output name=artifact-build-name::$artifact_build_name" + echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` + - name: Checkout outboard if: ${{ env.outboard_repository != '' && env.outboard_ref != '' }} uses: actions/checkout@v2 @@ -89,10 +105,8 @@ run: west zephyr-export - name: Build (west build) run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: Prepare artifacts + - name: Prepare firmware artifacts run: | - mkdir ${{ steps.variables.outputs.artifact-dir }} - cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" for extension in "hex" "uf2" do file="build/zephyr/zmk.$extension" diff --git a/.github/workflows/src/test-boards.yml.m4 b/.github/workflows/src/test-boards.yml.m4 index 7cbeda0..36ea46f 100644 --- a/.github/workflows/src/test-boards.yml.m4 +++ b/.github/workflows/src/test-boards.yml.m4 @@ -23,4 +23,6 @@ m4_include(include/jobs-build.yml.m4)m4_dnl - default mapping: - default + kconfig: + - default m4_include(include/build-steps.yml.m4)m4_dnl diff --git a/.github/workflows/src/test-build.yml.m4 b/.github/workflows/src/test-build.yml.m4 index 8e3b32c..d1040e6 100644 --- a/.github/workflows/src/test-build.yml.m4 +++ b/.github/workflows/src/test-build.yml.m4 @@ -31,4 +31,6 @@ jobs: - default mapping: - default + kconfig: + - default m4_include(include/build-steps.yml.m4)m4_dnl diff --git a/.github/workflows/src/test-configs.yml.m4 b/.github/workflows/src/test-configs.yml.m4 index 92c20bd..5dd1cdc 100644 --- a/.github/workflows/src/test-configs.yml.m4 +++ b/.github/workflows/src/test-configs.yml.m4 @@ -29,4 +29,6 @@ m4_include(include/jobs-build.yml.m4)m4_dnl # - flip # TODO mapping: - default + kconfig: + - default m4_include(include/build-steps.yml.m4)m4_dnl diff --git a/.github/workflows/src/test-controllers.yml.m4 b/.github/workflows/src/test-controllers.yml.m4 index 2a52cbe..5e97e8a 100644 --- a/.github/workflows/src/test-controllers.yml.m4 +++ b/.github/workflows/src/test-controllers.yml.m4 @@ -22,4 +22,6 @@ m4_include(include/jobs-build.yml.m4)m4_dnl - default mapping: - default + kconfig: + - default m4_include(include/build-steps.yml.m4)m4_dnl diff --git a/.github/workflows/src/test-shields.yml.m4 b/.github/workflows/src/test-shields.yml.m4 index 6778a57..3a8d251 100644 --- a/.github/workflows/src/test-shields.yml.m4 +++ b/.github/workflows/src/test-shields.yml.m4 @@ -66,4 +66,6 @@ m4_include(include/jobs-build.yml.m4)m4_dnl - default mapping: - default + kconfig: + - default m4_include(include/build-steps.yml.m4)m4_dnl diff --git a/.github/workflows/test-boards.yml b/.github/workflows/test-boards.yml index cdaf9d9..51a20d3 100644 --- a/.github/workflows/test-boards.yml +++ b/.github/workflows/test-boards.yml @@ -33,6 +33,8 @@ jobs: - default mapping: - default + kconfig: + - default steps: - name: Checkout uses: actions/checkout@v2 @@ -40,7 +42,6 @@ jobs: id: variables run: | if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ] - then SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" keyboard=${{ matrix.shield }} @@ -68,17 +69,34 @@ jobs: ;; esac done - artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` - echo "::set-output name=artifact-build-name::$artifact_build_name" - echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` - echo "::set-output name=artifact-dir::artifacts" - outboard_file=".github/workflows/outboards/$keyboard" + artifacts_dir="artifacts" + echo "::set-output name=artifact-dir::$artifacts_dir" + mkdir "$artifacts_dir" + cp "$configfile" "$artifacts_dir" + + if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] + then + kconfig_file="config/$keyboard.conf" + echo "${{ matrix.kconfig }}" > "$kconfig_file" + cat "$kconfig_file" + cp "$kconfig_file" "$artifacts_dir" + artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` + fi + + outboard_file=".github/workflows/outboards/$keyboard.outboard" if [ -f "$outboard_file" ] then grep -v '^#' "$outboard_file" >> $GITHUB_ENV + cat "$outboard_file" + cp "$outboard_file" "$artifacts_dir" fi echo "::set-output name=outboard_dir::outboard" + + artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` + echo "::set-output name=artifact-build-name::$artifact_build_name" + echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` + - name: Checkout outboard if: ${{ env.outboard_repository != '' && env.outboard_ref != '' }} uses: actions/checkout@v2 @@ -124,10 +142,8 @@ jobs: run: west zephyr-export - name: Build (west build) run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: Prepare artifacts + - name: Prepare firmware artifacts run: | - mkdir ${{ steps.variables.outputs.artifact-dir }} - cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" for extension in "hex" "uf2" do file="build/zephyr/zmk.$extension" diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index 9a077a3..0a019cd 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -32,6 +32,8 @@ jobs: - default mapping: - default + kconfig: + - default steps: - name: Checkout uses: actions/checkout@v2 @@ -39,7 +41,6 @@ jobs: id: variables run: | if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ] - then SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" keyboard=${{ matrix.shield }} @@ -67,17 +68,34 @@ jobs: ;; esac done - artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` - echo "::set-output name=artifact-build-name::$artifact_build_name" - echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` - echo "::set-output name=artifact-dir::artifacts" - outboard_file=".github/workflows/outboards/$keyboard" + artifacts_dir="artifacts" + echo "::set-output name=artifact-dir::$artifacts_dir" + mkdir "$artifacts_dir" + cp "$configfile" "$artifacts_dir" + + if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] + then + kconfig_file="config/$keyboard.conf" + echo "${{ matrix.kconfig }}" > "$kconfig_file" + cat "$kconfig_file" + cp "$kconfig_file" "$artifacts_dir" + artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` + fi + + outboard_file=".github/workflows/outboards/$keyboard.outboard" if [ -f "$outboard_file" ] then grep -v '^#' "$outboard_file" >> $GITHUB_ENV + cat "$outboard_file" + cp "$outboard_file" "$artifacts_dir" fi echo "::set-output name=outboard_dir::outboard" + + artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` + echo "::set-output name=artifact-build-name::$artifact_build_name" + echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` + - name: Checkout outboard if: ${{ env.outboard_repository != '' && env.outboard_ref != '' }} uses: actions/checkout@v2 @@ -123,10 +141,8 @@ jobs: run: west zephyr-export - name: Build (west build) run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: Prepare artifacts + - name: Prepare firmware artifacts run: | - mkdir ${{ steps.variables.outputs.artifact-dir }} - cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" for extension in "hex" "uf2" do file="build/zephyr/zmk.$extension" diff --git a/.github/workflows/test-configs.yml b/.github/workflows/test-configs.yml index 7750651..06e08fd 100644 --- a/.github/workflows/test-configs.yml +++ b/.github/workflows/test-configs.yml @@ -39,6 +39,8 @@ jobs: # - flip # TODO mapping: - default + kconfig: + - default steps: - name: Checkout uses: actions/checkout@v2 @@ -46,7 +48,6 @@ jobs: id: variables run: | if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ] - then SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" keyboard=${{ matrix.shield }} @@ -74,17 +75,34 @@ jobs: ;; esac done - artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` - echo "::set-output name=artifact-build-name::$artifact_build_name" - echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` - echo "::set-output name=artifact-dir::artifacts" - outboard_file=".github/workflows/outboards/$keyboard" + artifacts_dir="artifacts" + echo "::set-output name=artifact-dir::$artifacts_dir" + mkdir "$artifacts_dir" + cp "$configfile" "$artifacts_dir" + + if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] + then + kconfig_file="config/$keyboard.conf" + echo "${{ matrix.kconfig }}" > "$kconfig_file" + cat "$kconfig_file" + cp "$kconfig_file" "$artifacts_dir" + artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` + fi + + outboard_file=".github/workflows/outboards/$keyboard.outboard" if [ -f "$outboard_file" ] then grep -v '^#' "$outboard_file" >> $GITHUB_ENV + cat "$outboard_file" + cp "$outboard_file" "$artifacts_dir" fi echo "::set-output name=outboard_dir::outboard" + + artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` + echo "::set-output name=artifact-build-name::$artifact_build_name" + echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` + - name: Checkout outboard if: ${{ env.outboard_repository != '' && env.outboard_ref != '' }} uses: actions/checkout@v2 @@ -130,10 +148,8 @@ jobs: run: west zephyr-export - name: Build (west build) run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: Prepare artifacts + - name: Prepare firmware artifacts run: | - mkdir ${{ steps.variables.outputs.artifact-dir }} - cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" for extension in "hex" "uf2" do file="build/zephyr/zmk.$extension" diff --git a/.github/workflows/test-controllers.yml b/.github/workflows/test-controllers.yml index 8769711..441595e 100644 --- a/.github/workflows/test-controllers.yml +++ b/.github/workflows/test-controllers.yml @@ -32,6 +32,8 @@ jobs: - default mapping: - default + kconfig: + - default steps: - name: Checkout uses: actions/checkout@v2 @@ -39,7 +41,6 @@ jobs: id: variables run: | if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ] - then SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" keyboard=${{ matrix.shield }} @@ -67,17 +68,34 @@ jobs: ;; esac done - artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` - echo "::set-output name=artifact-build-name::$artifact_build_name" - echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` - echo "::set-output name=artifact-dir::artifacts" - outboard_file=".github/workflows/outboards/$keyboard" + artifacts_dir="artifacts" + echo "::set-output name=artifact-dir::$artifacts_dir" + mkdir "$artifacts_dir" + cp "$configfile" "$artifacts_dir" + + if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] + then + kconfig_file="config/$keyboard.conf" + echo "${{ matrix.kconfig }}" > "$kconfig_file" + cat "$kconfig_file" + cp "$kconfig_file" "$artifacts_dir" + artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` + fi + + outboard_file=".github/workflows/outboards/$keyboard.outboard" if [ -f "$outboard_file" ] then grep -v '^#' "$outboard_file" >> $GITHUB_ENV + cat "$outboard_file" + cp "$outboard_file" "$artifacts_dir" fi echo "::set-output name=outboard_dir::outboard" + + artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` + echo "::set-output name=artifact-build-name::$artifact_build_name" + echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` + - name: Checkout outboard if: ${{ env.outboard_repository != '' && env.outboard_ref != '' }} uses: actions/checkout@v2 @@ -123,10 +141,8 @@ jobs: run: west zephyr-export - name: Build (west build) run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: Prepare artifacts + - name: Prepare firmware artifacts run: | - mkdir ${{ steps.variables.outputs.artifact-dir }} - cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" for extension in "hex" "uf2" do file="build/zephyr/zmk.$extension" diff --git a/.github/workflows/test-shields.yml b/.github/workflows/test-shields.yml index d13d29c..b370d45 100644 --- a/.github/workflows/test-shields.yml +++ b/.github/workflows/test-shields.yml @@ -76,6 +76,8 @@ jobs: - default mapping: - default + kconfig: + - default steps: - name: Checkout uses: actions/checkout@v2 @@ -83,7 +85,6 @@ jobs: id: variables run: | if [ -n "${{ matrix.shield }}" -a "${{ matrix.shield }}" != "default" ] - then SHIELD_ARG="-DSHIELD=${{ matrix.shield }}" keyboard=${{ matrix.shield }} @@ -111,17 +112,34 @@ jobs: ;; esac done - artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` - echo "::set-output name=artifact-build-name::$artifact_build_name" - echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` - echo "::set-output name=artifact-dir::artifacts" - outboard_file=".github/workflows/outboards/$keyboard" + artifacts_dir="artifacts" + echo "::set-output name=artifact-dir::$artifacts_dir" + mkdir "$artifacts_dir" + cp "$configfile" "$artifacts_dir" + + if [ -n "${{ matrix.kconfig }}" -a "${{ matrix.kconfig }}" != 'default' ] + then + kconfig_file="config/$keyboard.conf" + echo "${{ matrix.kconfig }}" > "$kconfig_file" + cat "$kconfig_file" + cp "$kconfig_file" "$artifacts_dir" + artifact_build_name="$artifact_build_name kconfig_"`echo "${{ matrix.kconfig }}" | md5sum | cut -d ' ' -f 1` + fi + + outboard_file=".github/workflows/outboards/$keyboard.outboard" if [ -f "$outboard_file" ] then grep -v '^#' "$outboard_file" >> $GITHUB_ENV + cat "$outboard_file" + cp "$outboard_file" "$artifacts_dir" fi echo "::set-output name=outboard_dir::outboard" + + artifact_build_name=`echo $artifact_build_name | tr ' ' '-'` + echo "::set-output name=artifact-build-name::$artifact_build_name" + echo "::set-output name=artifact-generic-name::"`echo "$artifact_build_name" | sed 's/_\(left\|right\)//'` + - name: Checkout outboard if: ${{ env.outboard_repository != '' && env.outboard_ref != '' }} uses: actions/checkout@v2 @@ -167,10 +185,8 @@ jobs: run: west zephyr-export - name: Build (west build) run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: Prepare artifacts + - name: Prepare firmware artifacts run: | - mkdir ${{ steps.variables.outputs.artifact-dir }} - cp "${{ steps.variables.outputs.configfile }}" "${{ steps.variables.outputs.artifact-dir }}" for extension in "hex" "uf2" do file="build/zephyr/zmk.$extension" diff --git a/readme.org b/readme.org index 63588dc..8ec046a 100644 --- a/readme.org +++ b/readme.org @@ -5,7 +5,7 @@ [[https://raw.githubusercontent.com/manna-harbour/miryoku/master/data/cover/miryoku-kle-cover.png]] -[[https://github.com/manna-harbour/miryoku/][Miryoku]] is an ergonomic, minimal, orthogonal, and universal keyboard layout. This is the miryoku implementation for [[https://zmkfirmware.dev/][ZMK]]. +[[https://github.com/manna-harbour/miryoku/][Miryoku]] is an ergonomic, minimal, orthogonal, and universal keyboard layout. This is the Miryoku implementation for [[https://zmkfirmware.dev/][ZMK]]. * Contents :TOC_1: - [[#building][Building]] @@ -49,15 +49,19 @@ Clone this repo and use for [[https://zmk.dev/docs/development/build-flash#build Workflow files are in [[.github/workflows]]. To access a workflow, log in to GitHub, visit the [[https://github.com/manna-harbour/zmk-config/actions][Actions]] tab, and select the workflow. To download the firmware from a workflow run, select the workflow, select the workflow run, select the desired Artifacts, and unzip the downloaded zip file. +[[#Supported-Keyboards][Supported keyboards]] and [[#configuration-options][configuration options]] can be used as values for the corresponding [[#build-examples][matrix]] or [[#build-inputs][inputs]] options. -*** Build Inputs - -Fork this repo, select the [[https://github.com/manna-harbour/zmk-config/actions/workflows/build-inputs.yml][Build Inputs]] workflow, select Run workflow, fill out the form with [[#Supported-Keyboards][supported keyboards]] and [[#configuration-options][configuration options]], activate Run workflow, wait for successful completion. Multiple (comma and / or space separated) values can be entered in each field. +The ~kconfig~ option can be used to generate a ~keyboard.conf~. Join multiple lines with ~\n~. *** Build Examples -Fork this repo, copy one the included Build Example workflow files, edit the ~name~ value, and edit the values for the desired [[#Supported-Keyboards][supported keyboards]] and [[#configuration-options][configuration options]]. +Fork this repo, copy one of the included Build Example workflow files, edit the ~name~ value, and edit the values for each matrix option as desired. + + +*** Build Inputs + +Fork this repo, select the [[https://github.com/manna-harbour/zmk-config/actions/workflows/build-inputs.yml][Build Inputs]] workflow, select Run workflow, and fill out the form as desired. Multiple (comma and / or space separated) values can be entered in each field. Activate Run workflow, and wait for successful completion. *** Prebuilt Firmware @@ -67,7 +71,7 @@ Some prebuilt firmware is available from previous workflow runs. * Miryoku Keymap -The miryoku keymap is a ZMK DT keymap file using C preprocessor macros for [[#configuration-options][configuration options]] and to abstract the physical layout. The file is [[miryoku/miryoku.dtsi]]. The file is included into the [[#keyboard-keymaps][keyboard's keymap]] with +The Miryoku keymap is a ZMK DT keymap file using C preprocessor macros for [[#configuration-options][configuration options]] and to abstract the physical layout. The file is [[miryoku/miryoku.dtsi]]. The file is included into the [[#keyboard-keymaps][keyboard's keymap]] with #+BEGIN_SRC C :tangle no #include "../miryoku/miryoku.dtsi" @@ -114,7 +118,7 @@ Below is an example [[#config-file][config file]] with the following keymap [[#c * Mapping -The keymap is mapped onto keyboards with different physical layouts. The keymap is specified in terms of the ~MIRYOKU_MAPPING~ macro. The macro is defined in a C header file for each physical layout. Unused keys are mapped to ~&none~. The files are in [[miryoku/mapping/]]. The mapping file is included into the keyboard's keymap file before the miryoku keymap with e.g. +The keymap is mapped onto keyboards with different physical layouts. The keymap is specified in terms of the ~MIRYOKU_MAPPING~ macro. The macro is defined in a C header file for each physical layout. Unused keys are mapped to ~&none~. The files are in [[miryoku/mapping/]]. The mapping file is included into the keyboard's keymap file before the Miryoku keymap with e.g. #+BEGIN_SRC C :tangle no #include "../miryoku/mapping/36-minidox.h"