From ee112bbcf4667c4c812d964412841c69d34f94c6 Mon Sep 17 00:00:00 2001
From: honorless <86894501+lesshonor@users.noreply.github.com>
Date: Sun, 19 Mar 2023 23:24:06 -0400
Subject: [PATCH 1/2] refactor: build all CI workflow
---
.github/workflows/ci.yml | 92 ++++++++++++++++++++++++++++++++++------
1 file changed, 80 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2a3439a370..9f9281d22c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,26 +1,94 @@
name: CI
+on: [ pull_request, push, workflow_dispatch ]
-on:
- push:
- workflow_dispatch:
- pull_request:
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
+ cancel-in-progress: true
+
+env:
+ REGEX_ANSI_COLOR: 's/\x1b\[[0-9;]*[mGKHF]//g'
+ REGEX_MAKE_OUTPUT: '/^g*make\[1]: \(Enter\|Leav\)ing directory ''/d'
+
+permissions: {}
jobs:
- build:
+ check-uid:
+ name: Check Vial UIDs for all keyboards
runs-on: ubuntu-latest
- container: qmkfm/qmk_cli
-
steps:
- - uses: actions/checkout@v2
+ - name: (actions) Checkout Vial repo
+ uses: actions/checkout@v3
with:
- fetch-depth: 0
+ persist-credentials: false
- name: Verify Vial UID is unique
run: python3 util/ci_vial_verify_uid.py
- - name: Compile Vial keyboards
+ build-default:
+ name: Build default keymaps for Vial
+ runs-on: ubuntu-latest
+ container: ghcr.io/qmk/qmk_cli
+ env:
+ KEYMAP: default
+
+ steps:
+ - name: (actions) Checkout Vial repo
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ submodules: recursive
+
+ - name: Build
+ id: build
run: |
git config --global --add safe.directory $(pwd)
- make git-submodule
- python3 util/ci_compile_vial_keyboards.py
+ qmk mass-compile -j $(nproc) $(qmk find -km vial | sed "s/:vial$/:${KEYMAP}/")
+
+ - name: Dump failure logs
+ if: ${{ failure() && steps.build.conclusion == 'failure' }}
+ run: |
+ echo '### Failure logs' | tee -a "${GITHUB_STEP_SUMMARY}"
+
+ cd .build || exit
+ for log in failed.log.*; do
+ pretty_logname="$(echo "${log}" | sed "s/^failed\.log\.[0-9]\+\.// ; s/\.${KEYMAP}$//")"
+
+ printf '\n::group::%s\n%s\n::endgroup::\n' "${pretty_logname}" "$(sed "${REGEX_MAKE_OUTPUT}" < "${log}")"
+ printf '\n\n%s
\n\n```\n%s\n```\n\n \n' \
+ "${pretty_logname}" "$(sed "${REGEX_MAKE_OUTPUT} ; ${REGEX_ANSI_COLOR}" < "${log}")" >> "${GITHUB_STEP_SUMMARY}"
+ done
+
+ build-vial:
+ name: Build Vial keymaps
+ runs-on: ubuntu-latest
+ container: ghcr.io/qmk/qmk_cli
+ env:
+ KEYMAP: vial
+
+ steps:
+ - name: (actions) Checkout Vial repo
+ uses: actions/checkout@v3
+ with:
+ persist-credentials: false
+ submodules: recursive
+
+ - name: Build
+ id: build
+ run: |
+ git config --global --add safe.directory $(pwd)
+ qmk mass-compile -km "${KEYMAP}" -j $(nproc)
+
+ - name: Dump failure logs
+ if: ${{ failure() && steps.build.conclusion == 'failure' }}
+ run: |
+ echo '### Failure logs' | tee -a "${GITHUB_STEP_SUMMARY}"
+
+ cd .build || exit
+ for log in failed.log.*; do
+ pretty_logname="$(echo "${log}" | sed "s/^failed\.log\.[0-9]\+\.// ; s/\.${KEYMAP}$//")"
+
+ printf '\n::group::%s\n%s\n::endgroup::\n' "${pretty_logname}" "$(sed "${REGEX_MAKE_OUTPUT}" < "${log}")"
+ printf '\n\n%s
\n\n```\n%s\n```\n\n \n' \
+ "${pretty_logname}" "$(sed "${REGEX_MAKE_OUTPUT} ; ${REGEX_ANSI_COLOR}" < "${log}")" >> "${GITHUB_STEP_SUMMARY}"
+ done
From 9c99548fa32f263a140c6db2111645a4851da0da Mon Sep 17 00:00:00 2001
From: honorless <86894501+lesshonor@users.noreply.github.com>
Date: Mon, 5 Jun 2023 07:52:40 -0400
Subject: [PATCH 2/2] feat: keymap failure count
---
.github/workflows/ci.yml | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9f9281d22c..6c28bbb39a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -13,7 +13,7 @@ permissions: {}
jobs:
check-uid:
- name: Check Vial UIDs for all keyboards
+ name: Check Vial UIDs
runs-on: ubuntu-latest
steps:
@@ -22,7 +22,7 @@ jobs:
with:
persist-credentials: false
- - name: Verify Vial UID is unique
+ - name: Verify Vial UID is unique per-keyboard
run: python3 util/ci_vial_verify_uid.py
build-default:
@@ -43,14 +43,18 @@ jobs:
id: build
run: |
git config --global --add safe.directory $(pwd)
- qmk mass-compile -j $(nproc) $(qmk find -km vial | sed "s/:vial$/:${KEYMAP}/")
+ if ! qmk mass-compile -j $(nproc) $(qmk find -km vial | sed "s/:vial$/:${KEYMAP}/");
+ then
+ echo "::error::$(ls -1 .build/failed.log.* | wc -l) keymaps failed to build. See logs and/or job summary for details."
+ exit 1
+ fi
- name: Dump failure logs
if: ${{ failure() && steps.build.conclusion == 'failure' }}
run: |
echo '### Failure logs' | tee -a "${GITHUB_STEP_SUMMARY}"
- cd .build || exit
+ cd .build || exit 1
for log in failed.log.*; do
pretty_logname="$(echo "${log}" | sed "s/^failed\.log\.[0-9]\+\.// ; s/\.${KEYMAP}$//")"
@@ -77,14 +81,18 @@ jobs:
id: build
run: |
git config --global --add safe.directory $(pwd)
- qmk mass-compile -km "${KEYMAP}" -j $(nproc)
+ if ! qmk mass-compile -km "${KEYMAP}" -j $(nproc);
+ then
+ echo "::error::$(ls -1 .build/failed.log.* | wc -l) keymaps failed to build. See logs and/or job summary for details."
+ exit 1
+ fi
- name: Dump failure logs
if: ${{ failure() && steps.build.conclusion == 'failure' }}
run: |
echo '### Failure logs' | tee -a "${GITHUB_STEP_SUMMARY}"
- cd .build || exit
+ cd .build || exit 1
for log in failed.log.*; do
pretty_logname="$(echo "${log}" | sed "s/^failed\.log\.[0-9]\+\.// ; s/\.${KEYMAP}$//")"