Skip to content

Commit

Permalink
Merge upstream main
Browse files Browse the repository at this point in the history
  • Loading branch information
nickconway committed Jun 2, 2023
2 parents cc042ce + b276a3b commit b0ff225
Show file tree
Hide file tree
Showing 1,107 changed files with 33,200 additions and 19,214 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/zmkfirmware/zmk-dev-arm:3.0
FROM docker.io/zmkfirmware/zmk-dev-arm:3.2

COPY .bashrc tmp
RUN mv /tmp/.bashrc ~/.bashrc
71 changes: 30 additions & 41 deletions .github/workflows/build-user-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
type: string
artifact_name:
description: "Artifact output file name"
archive_name:
description: "Archive output file name"
default: "firmware"
required: false
type: string
Expand All @@ -29,21 +31,18 @@ jobs:
runs-on: ubuntu-latest
name: Fetch Build Keyboards
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
build_matrix: ${{ env.build_matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install yaml2json
run: python3 -m pip install remarshal

- name: Fetch Build Matrix
id: set-matrix
run: |
set -x
matrix=$(yaml2json ${{ inputs.build_matrix_path }} | jq -c .)
yaml2json ${{ inputs.build_matrix_path }}
echo "::set-output name=matrix::${matrix}"
echo "build_matrix=$(yaml2json '${{ inputs.build_matrix_path }}' | jq -c .)" >> $GITHUB_ENV
yaml2json "${{ inputs.build_matrix_path }}" | jq
build:
runs-on: ubuntu-latest
Expand All @@ -53,79 +52,69 @@ jobs:
name: Build
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
matrix: ${{ fromJson(needs.matrix.outputs.build_matrix) }}
steps:
- name: Prepare variables
id: variables
shell: sh -x {0}
env:
shield: ${{ matrix.shield }}
run: |
set -x
if [ -n "${{ matrix.shield }}" ]
then
EXTRA_CMAKE_ARGS="-DSHIELD=${{ matrix.shield }}"
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
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}
echo ::set-output name=zephyr-version::${ZEPHYR_VERSION}
echo "zephyr_version=${ZEPHYR_VERSION}" >> $GITHUB_ENV
echo "extra_cmake_args=${shield:+-DSHIELD=\"$shield\"}" >> $GITHUB_ENV
echo "display_name=${shield:+$shield - }${{ matrix.board }}" >> $GITHUB_ENV
echo "artifact_name=${shield:+$shield-}${{ matrix.board }}-zmk" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache west modules
uses: actions/cache@v3.0.2
uses: actions/cache@v3.0.11
continue-on-error: true
env:
cache-name: cache-zephyr-${{ steps.variables.outputs.zephyr-version }}-modules
cache_name: cache-zephyr-${{ env.zephyr_version }}-modules
with:
path: |
modules/
tools/
zephyr/
bootloader/
zmk/
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }}
key: ${{ runner.os }}-build-${{ env.cache_name }}-${{ hashFiles('**/west.yml', '**/build.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-${{ env.cache_name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: West Init
run: west init -l ${{ inputs.config_path }}
run: west init -l "${{ inputs.config_path }}"

- name: West Update
run: west update

- name: West Zephyr export
run: west zephyr-export

- name: West Build (${{ steps.variables.outputs.display-name }})
run: |
set -x
west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/${{ inputs.config_path }} ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }}
- name: West Build (${{ env.display_name }})
shell: sh -x {0}
run: west build -s zmk/app -b "${{ matrix.board }}" -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/${{ inputs.config_path }}" ${{ env.extra_cmake_args }} ${{ matrix.cmake-args }}

- name: ${{ steps.variables.outputs.display-name }} Kconfig file
- name: ${{ env.display_name }} Kconfig file
run: grep -v -e "^#" -e "^$" build/zephyr/.config | sort

- name: Rename artifacts
shell: sh -x {0}
run: |
set -x
mkdir build/artifacts
if [ -f build/zephyr/zmk.uf2 ]
then
cp build/zephyr/zmk.uf2 "build/artifacts/${{ steps.variables.outputs.artifact-name }}.uf2"
cp build/zephyr/zmk.uf2 "build/artifacts/${{ env.artifact_name }}.uf2"
elif [ -f build/zephyr/zmk.${{ inputs.fallback_binary }} ]
then
cp build/zephyr/zmk.${{ inputs.fallback_binary }} "build/artifacts/${{ steps.variables.outputs.artifact-name }}.${{ inputs.fallback_binary }}"
cp "build/zephyr/zmk.${{ inputs.fallback_binary }}" "build/artifacts/${{ env.artifact_name }}.${{ inputs.fallback_binary }}"
fi
- name: Archive (${{ steps.variables.outputs.display-name }})
uses: actions/upload-artifact@v2
- name: Archive (${{ env.display_name }})
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact_name }}
name: ${{ inputs.archive_name }}
path: build/artifacts
33 changes: 18 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
if: ${{ always() }}
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-build-arm:3.0
image: docker.io/zmkfirmware/zmk-build-arm:3.2
needs: compile-matrix
strategy:
matrix:
include: ${{ fromJSON(needs.compile-matrix.outputs.include-list) }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Cache west modules
uses: actions/cache@v3.0.2
env:
Expand All @@ -35,11 +35,11 @@ jobs:
tools/
zephyr/
bootloader/
key: 4-${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }}
restore-keys: |
4-${{ runner.os }}-build-${{ env.cache-name }}-
4-${{ runner.os }}-build-
4-${{ runner.os }}-
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
timeout-minutes: 2
continue-on-error: true
- name: Initialize workspace (west init)
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
for (const shieldArgs of buildShieldArgs) {
try {
const output = execSync(`west build -s app -p -b ${{ matrix.board }} -- ${shieldArgs.shield ? '-DSHIELD=' + shieldArgs.shield : ''} ${shieldArgs['cmake-args'] || ''}`);
const output = execSync(`west build -s app -p -b ${{ matrix.board }} -- ${shieldArgs.shield ? '-DSHIELD="' + shieldArgs.shield + '"' : ''} ${shieldArgs['cmake-args'] || ''}`);
console.log(`::group::${{ matrix.board}} ${shieldArgs.shield} Build`)
console.log(output.toString());
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
for (const configuration of combinedUnique) {
if (!perBoard[configuration.board])
perBoard[configuration.board] = [];
perBoard[configuration.board].push({
shield: configuration.shield,
'cmake-args': configuration['cmake-args'],
Expand All @@ -151,7 +151,7 @@ jobs:
core-include: ${{ steps.core-list.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -180,7 +180,7 @@ jobs:
boards-include: ${{ steps.boards-list.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
with:
Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:
};
}
} else if (hm.exposes) {
return hm.exposes.flatMap(i =>
return hm.exposes.flatMap(i =>
metadata.interconnects[i].shields.flatMap(s => boardAndShield(hm, s))
);
} else {
Expand All @@ -243,9 +243,12 @@ jobs:
break;
case "shield":
if (hm.features && hm.features.includes("keys")) {
return hm.requires.flatMap(i =>
return hm.requires.flatMap(i =>
metadata.interconnects[i].boards.flatMap(b => boardAndShield(b, hm))
);
} else {
console.warn("Unhandled shield without keys");
return [];
}
break;
case "interconnect":
Expand Down Expand Up @@ -304,7 +307,7 @@ jobs:
organized-metadata: ${{ steps.organize-metadata.outputs.result }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
with:
Expand All @@ -326,7 +329,7 @@ jobs:
yaml.loadAll(fs.readFileSync(f, "utf8"))
);
return JSON.stringify(aggregated).replace(/\\/g,"\\\\");
return JSON.stringify(aggregated).replace(/\\/g,"\\\\").replace(/`/g,"\\`");
result-encoding: string

- name: Organize Metadata
Expand Down Expand Up @@ -373,7 +376,7 @@ jobs:
},
{ onboard: [], interconnects: {} });
return JSON.stringify(grouped).replace(/\\/g,"\\\\");
return JSON.stringify(grouped).replace(/\\/g,"\\\\").replace(/`/g,"\\`");
result-encoding: string
get-changed-files:
if: ${{ github.event_name != 'schedule' }}
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/clang-format-lint.yml

This file was deleted.

14 changes: 2 additions & 12 deletions .github/workflows/doc-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,17 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: bahmutov/npm-install@v1
with:
working-directory: docs
- name: ESLint
run: npm run lint
working-directory: docs
prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bahmutov/npm-install@v1
with:
working-directory: docs
- name: Prettier check
run: npm run prettier:check
working-directory: docs
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: bahmutov/npm-install@v1
with:
working-directory: docs
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/hardware-metadata-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,12 @@ on:
- "app/scripts/west_commands/metadata.py"

jobs:
check-metadata-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: bahmutov/npm-install@v1
with:
working-directory: app
- name: Prettier Check
run: npm run prettier:check
working-directory: app
validate-metadata:
runs-on: ubuntu-latest
container:
image: docker.io/zmkfirmware/zmk-dev-arm:3.0
image: docker.io/zmkfirmware/zmk-dev-arm:3.2
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: pip install -r app/scripts/requirements.txt
- name: West init
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pre-commit

on:
pull_request:
push:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.0
Loading

0 comments on commit b0ff225

Please sign in to comment.