From 06dbda9892f423a4eab9562b2235be6fcb80b29b Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 14 Mar 2023 14:56:35 +1100 Subject: [PATCH 1/3] Let's use workflows to parallelise the builds. --- .github/workflows/ci_builds.yml | 50 ++++++++++++++++++++++++++++-- lib/python/qmk/cli/mass_compile.py | 2 +- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_builds.yml b/.github/workflows/ci_builds.yml index 64c7678d5313..d45e9fe4ddcf 100644 --- a/.github/workflows/ci_builds.yml +++ b/.github/workflows/ci_builds.yml @@ -22,6 +22,43 @@ jobs: keymap: - default - via + keyboard_folder: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + - 7 + - 8 + - 9 + - a + - b + - c + - d + - e + - f + - g + - h + - i + - j + - k + - l + - m + - n + - o + - p + - q + - r + - s + - t + - u + - v + - w + - x + - y + - z container: qmkfm/qmk_cli @@ -36,5 +73,14 @@ jobs: - name: Install dependencies run: pip3 install -r requirements.txt - - name: Run `qmk mass-compile` (keymap ${{ matrix.keymap }}) - run: qmk mass-compile -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) -km ${{ matrix.keymap }} + - name: Run `qmk mass-compile` (keyboards ${{ matrix.keyboard_folder }}*, keymap ${{ matrix.keymap }}) + run: qmk mass-compile -j $(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) -km ${{ matrix.keymap }} -f 'keyboard_folder=${{ matrix.keyboard_folder }}*' + + - name: 'Upload binaries' + uses: actions/upload-artifact@v3 + with: + name: Artifacts-${{ matrix.keyboard_folder }}-${{ matrix.keymap }} + path: | + *.bin + *.hex + *.uf2 diff --git a/lib/python/qmk/cli/mass_compile.py b/lib/python/qmk/cli/mass_compile.py index 2821a60c8794..810350b954bc 100755 --- a/lib/python/qmk/cli/mass_compile.py +++ b/lib/python/qmk/cli/mass_compile.py @@ -106,7 +106,7 @@ def mass_compile(cli): def _make_filter(k, v): expr = fnmatch.translate(v) - rule = re.compile(expr, re.IGNORECASE) + rule = re.compile(f'^{expr}$', re.IGNORECASE) def f(e): lhs = e[2].get(k) From 282c3c1907654a5f1287d447ec922baa5f8ff35c Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 14 Mar 2023 15:01:11 +1100 Subject: [PATCH 2/3] Nofail if files aren't present. --- .github/workflows/ci_builds.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_builds.yml b/.github/workflows/ci_builds.yml index d45e9fe4ddcf..f4cad94b42ab 100644 --- a/.github/workflows/ci_builds.yml +++ b/.github/workflows/ci_builds.yml @@ -80,6 +80,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: Artifacts-${{ matrix.keyboard_folder }}-${{ matrix.keymap }} + if-no-files-found: ignore path: | *.bin *.hex From e24a6aba3d8a4e9c56f8e1c9b0a07845e4f09022 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 14 Mar 2023 19:20:01 +1100 Subject: [PATCH 3/3] Formatting. --- .github/workflows/ci_builds.yml | 44 +++------------------------------ 1 file changed, 3 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci_builds.yml b/.github/workflows/ci_builds.yml index f4cad94b42ab..e2bbd9349763 100644 --- a/.github/workflows/ci_builds.yml +++ b/.github/workflows/ci_builds.yml @@ -19,46 +19,8 @@ jobs: strategy: matrix: - keymap: - - default - - via - keyboard_folder: - - 0 - - 1 - - 2 - - 3 - - 4 - - 5 - - 6 - - 7 - - 8 - - 9 - - a - - b - - c - - d - - e - - f - - g - - h - - i - - j - - k - - l - - m - - n - - o - - p - - q - - r - - s - - t - - u - - v - - w - - x - - y - - z + keymap: [default, via] + keyboard_folder: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z] container: qmkfm/qmk_cli @@ -79,7 +41,7 @@ jobs: - name: 'Upload binaries' uses: actions/upload-artifact@v3 with: - name: Artifacts-${{ matrix.keyboard_folder }}-${{ matrix.keymap }} + name: binaries-${{ matrix.keyboard_folder }}-${{ matrix.keymap }} if-no-files-found: ignore path: | *.bin