-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update QMK - [GitHub Action] * Validate QMK * Fix format * Fix action submodules * Try to speed up builds by setting up a nix cache * Fix cache key hash * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Add nix-community cache * Set up cachix * Remove concurrency check * Skip cachix auto push * Let cachix check what should be pushed Plus, size estimation was way off * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Update QMK - [GitHub Action] * Fix release * Fix release (again) * Add check workflow * Fix job name * Small fixes * Enhance setup script * Update QMK - [GitHub Action] * Add format command And reformat code to comply * Fix format Configuration was not being detected, and qmk filters some files * Only release on relevant changes * Update QMK - [GitHub Action] * Fix workflow style * Increase update frequency * Fix update branch * Try and test the full shell.nix logic * Try to fix expressions * Try even harder * Maybe I overcomplicated things * Fix the validation * Disable setup since that requires root access * Try to execute as much as possible * Fix cache push * Make linter readable * Shorten comment * Try to make final check more readable * Fix expression? * Fix style * Use script's own update process * Add some more words to the dictionary * Rework initialisation * Fix shell import to match convention * Set up better default man pager * Fix hardcoded value * Use different keyboard for better portability test * Better root dir detection Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
f562cea
commit 5889ef6
Showing
12 changed files
with
721 additions
and
438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
name: Check code quality | ||
|
||
on: | ||
push: | ||
branches: [ main, develop ] | ||
paths: | ||
- 'keymap/**' | ||
- 'QMK' | ||
- 'shell.nix' | ||
- '.github/workflows/check.yml' | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
check: | ||
name: Check code quality | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
path: ./repo | ||
|
||
- name: Set up Nix | ||
uses: cachix/install-nix-action@v15 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-unstable | ||
extra_nix_config: | | ||
experimental-features = nix-command | ||
- name: Set up cache | ||
uses: cachix/cachix-action@v10 | ||
with: | ||
name: kip93 | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
extraPullNames: nix-community | ||
skipPush: true | ||
|
||
- name: Print nixpkgs version | ||
run: | | ||
nix-instantiate --eval -E '"nixpkgs version: ${(import <nixpkgs> {}).lib.version}"' | ||
- name: Shellcheck shell.nix | ||
id: shellcheck | ||
working-directory: ./repo | ||
run: | | ||
( | ||
printf '#!/bin/bash\n' ; | ||
nix-shell --pure shell.nix --run : >/dev/null ; | ||
nix-instantiate shell.nix 2>/dev/null | xargs -i sed '1,5d' {} ; | ||
) | nix-shell -p shellcheck --run 'shellcheck -' | ||
continue-on-error: true | ||
|
||
- name: QMK Format | ||
id: qmk-format | ||
working-directory: ./repo | ||
run: | | ||
nix-shell --run format | ||
git diff --exit-code --name-only | ||
continue-on-error: true | ||
|
||
- name: QMK Lint | ||
id: qmk-lint | ||
working-directory: ./repo | ||
run: | | ||
nix-shell --run lint | ||
continue-on-error: true | ||
|
||
- name: Check shell.nix format | ||
id: nixpkgs-fmt | ||
working-directory: ./repo | ||
run: | | ||
nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt --check shell.nix' | ||
continue-on-error: true | ||
|
||
- name: Lint shell.nix | ||
id: nix-linter | ||
working-directory: ./repo | ||
run: | | ||
nix-shell -p nix-linter --run ' \ | ||
nix-linter -W no-AlphabeticalArgs \ | ||
-W no-AlphabeticalBindings \ | ||
-W BetaReduction \ | ||
-W DIYInherit \ | ||
-W EmptyInherit \ | ||
-W EmptyLet \ | ||
-W no-EmptyVariadicParamSet \ | ||
-W FreeLetInFunc \ | ||
-W LetInInheritRecset \ | ||
-W no-ListLiteralConcat \ | ||
-W NegateAtom \ | ||
-W SequentialLet \ | ||
-W SetLiteralUpdate \ | ||
-W UnfortunateArgName \ | ||
-W no-UnneededAntiquote \ | ||
-W UnneededRec \ | ||
-W UnusedArg \ | ||
-W UnusedLetBind \ | ||
-W UpdateEmptySet \ | ||
-v shell.nix \ | ||
' | ||
continue-on-error: true | ||
|
||
- name: Check shell.nix for vulnerabilities | ||
id: vulnix | ||
working-directory: ./repo | ||
run: | | ||
nix-shell -p vulnix --run 'vulnix -f shell.nix' | ||
continue-on-error: true | ||
|
||
- name: Validate shell.nix logic | ||
id: validate | ||
working-directory: . | ||
run: | | ||
( | ||
mkdir -p ./tmp ; | ||
cp ./repo/shell.nix ./tmp/shell.nix ; | ||
sed -i -E 's|\bKEYBOARD\b\s*=\s*".+?"\s*;|KEYBOARD = "ergodox_ez";|' ./tmp/shell.nix ; | ||
cd ./tmp ; | ||
MANPAGER=cat nix-shell --run help ; | ||
nix-shell --pure --run init ; | ||
# nix-shell --pure --run setup ; # No root access, but not needed since we won't be flashing | ||
nix-shell --pure --run format ; | ||
nix-shell --pure --run lint ; | ||
nix-shell --pure --run compile ; | ||
# nix-shell --pure --run flash ; # Can't flash since there is no keyboard attached | ||
nix-shell --pure --run clean ; | ||
) | ||
continue-on-error: true | ||
|
||
- name: Check for failures | ||
if: | | ||
steps.shellcheck.outcome != 'success' || | ||
steps.qmk-format.outcome != 'success' || | ||
steps.qmk-lint.outcome != 'success' || | ||
steps.nixpkgs-fmt.outcome != 'success' || | ||
steps.nix-linter.outcome != 'success' || | ||
steps.vulnix.outcome != 'success' || | ||
steps.validate.outcome != 'success' | ||
run: exit 1 | ||
|
||
- name: Push to cache | ||
working-directory: ./repo | ||
run: | | ||
nix-shell --pure shell.nix --run : | ||
nix-store -qR --include-outputs $(nix-instantiate shell.nix 2>/dev/null) | cachix push kip93 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
cachix | ||
Corne | ||
github | ||
keycaps | ||
Keyhive | ||
keymap | ||
keymaps | ||
MCUs | ||
nix | ||
nixos | ||
nixpkgs | ||
ortholinear | ||
QMK |
Submodule QMK
updated
2056 files
Oops, something went wrong.