1
0
Fork 0

Migrate to matrix builds

This commit is contained in:
KemoNine 2021-02-19 00:49:10 +00:00
parent a17731441f
commit 7ceddaad57
2 changed files with 72 additions and 37 deletions

View file

@ -1,13 +1,20 @@
on: [push, pull_request, workflow_dispatch]
name: Build name: Build
on: [push, pull_request, workflow_dispatch]
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-20.04
container: container:
image: zmkfirmware/zmk-build-arm:2.4 image: zmkfirmware/zmk-build-arm:2.4
name: Build strategy:
fail-fast: false
matrix:
include:
- board: nice_nano
shield: corne_artsey_left
- board: nice_nano
shield: corne_artsey_right
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -17,47 +24,60 @@ jobs:
cache-name: cache-zephyr-modules cache-name: cache-zephyr-modules
with: with:
path: | path: |
bootloader/
modules/ modules/
tools/ tools/
zephyr/ zephyr/
bootloader/
zmk/ zmk/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('manifest-dir/west.yml') }} key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('config/west.yml') }}
restore-keys: | restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build- ${{ runner.os }}-build-
${{ runner.os }}- ${{ runner.os }}-
- name: West Init timeout-minutes: 2
continue-on-error: true
- name: Initialize workspace (west init)
run: west init -l config run: west init -l config
- name: West Update - name: Update modules (west update)
run: west update run: west update
- name: West Zephyr export - name: Export Zephyr CMake package (west zephyr-export)
run: west zephyr-export run: west zephyr-export
- name: ARTSEY dtsi File - name: Prepare variables
if: ${{ always() }} id: variables
run: cat -n ${GITHUB_WORKSPACE}/config/artsey.dtsi run: |
- name: West Build (Corne ARTSEY - Left) if [ -n "${{ matrix.shield }}" ]; then
run: west build -s zmk/app -b nice_nano -- -DSHIELD=corne_artsey_left -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" SHIELD_ARG="-DSHIELD=${{ matrix.shield }}"
- name: Corne ARTSEY - Left DTS File ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk-artsey"
if: ${{ always() }} else
run: cat -n build/zephyr/nice_nano.dts.pre.tmp SHIELD_ARG=
- name: Corne ARTSEY - Left Kconfig file ARTIFACT_NAME="${{ matrix.board }}-zmk-artsey"
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$" fi
- name: Rename zmk.uf2
run: cp build/zephyr/zmk.uf2 corne_artsey_left_nice_nano.uf2 echo ::set-output name=shield-arg::${SHIELD_ARG}
- name: Archive (Corne ARTSEY - Left) echo ::set-output name=artifact-name::${ARTIFACT_NAME}
- name: Build (west build)
run: west build -s zmk/app -b ${{ matrix.board }} -- ${{ steps.variables.outputs.shield-arg }} -DZMK_CONFIG="${GITHUB_WORKSPACE}/config"
- name: ARTSEY implementation dtsi file
if: always()
run: cat -n config/artsey.dtsi
- name: Generated DTS file
if: always()
run: cat -n build/zephyr/${{ matrix.board }}.dts.pre.tmp
- name: Prep artifact (artsey.dtsi)
run: cp config/artsey.dtsi ./artsey.dtsi
- name: Prep artifact (${{ matrix.shield }}-${{ matrix.board }}.dts.pre.tmp)
run: cp build/zephyr/${{ matrix.board }}.dts.pre.tmp ./${{ matrix.shield }}-${{ matrix.board }}.dts.pre.tmp
- name: Prep artifact (${{ matrix.shield }}-${{ matrix.board }}-zmk-artsey.hex)
run: cp build/zephyr/zmk.hex ${{ matrix.shield }}-${{ matrix.board }}-zmk-artsey.hex
- name: Prep artifact (${{ matrix.shield }}-${{ matrix.board }}-zmk-artsey.uf2)
run: cp build/zephyr/zmk.uf2 ${{ matrix.shield }}-${{ matrix.board }}-zmk-artsey.uf2
- name: Archive artifacts
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: firmware name: '${{ steps.variables.outputs.artifact-name }}'
path: corne_artsey_left_nice_nano.uf2 path: |
- name: West Build (Corne ARTSEY - Right) artsey.dtsi
run: west build --pristine -s zmk/app -b nice_nano -- -DSHIELD=corne_artsey_right -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" ${{ matrix.shield }}-${{ matrix.board }}.dts.pre.tmp
- name: Corne ARTSEY - Right Kconfig file ${{ matrix.shield }}-${{ matrix.board }}-zmk-artsey.hex
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$" ${{ matrix.shield }}-${{ matrix.board }}-zmk-artsey.uf2
- name: Rename zmk.uf2 continue-on-error: true
run: cp build/zephyr/zmk.uf2 corne_artsey_right_nice_nano.uf2
- name: Archive (Corne ARTSEY - Right)
uses: actions/upload-artifact@v2
with:
name: firmware
path: corne_artsey_right_nice_nano.uf2

View file

@ -1,15 +1,30 @@
# ZMK ARTSEY Implementation # ZMK ARTSEY Implementation
This repo contains the ZMK ARTSEY implementation This repo contains the ZMK ARTSEY implementation and pre-built firmware for boards that have been setup to use ARTSEY by the core ARTSEY development team.
## Prebuilt Firmware ## Prebuilt Firmware
The `Actions` tab of this repository contains the latest builds of the ZMK ARTSEY implementation. You can click on the most recent build, download the `firmware` artifact. It'll be a zip file with all of the ZMK ARTSEY firmware images built by our GitHub Actions. The `Actions` tab of this repository contains the latest builds of the ZMK ARTSEY implementation. You can click on the most recent build and download the appropriate artifact for your MCU + board combination. Inside the zip file will be the necessary file for flashing your MCU.
### Firmware Files
Inside the firmware zip file will be 4 files
- `artsey.dtsi`: The ARTSEY definition that was used for the build
- A file with `.dts.pre.tmp` at the end that is the generated DTS file used for the build (this is for any required troubleshooting)
- A file with `-zmk-artsey.hex` at the end that is the hex firmware image that can be used to flash your MCU
- A file with `-zmk-artsey.uf2` at the end that is the uf2 firmware image that can be used to flash your MCU
Please Note: the `hex` and `uf2` files may or may not be present depending on your MCU + board combo. **PLEASE** use the proper file for flashing your board.
**We are NOT responsible for any failed firmware flashes!**
## Adding ARTSEY Support ## Adding ARTSEY Support
If you'd like to add ARTSEY support to a board that supports ZMK but is not built by this repo. Please follow the standard ZMK docs on how to add a new shield but using this repo as your `zmk-config` and open a Pull Request. If you'd like to add ARTSEY support to a board that supports ZMK but is not built by this repo. Please follow the standard ZMK docs on how to add a new shield but using this repo as your `zmk-config` and open a Pull Request.
Also, update the `.github/workflows/build.yml` file for the new board being submitted.
Note: This repo is setup with github actions so you *can* work directly via GitHub Actions similar to how the ZMK documentation outlines. Note: This repo is setup with github actions so you *can* work directly via GitHub Actions similar to how the ZMK documentation outlines.
## Licensing ## Licensing