diff options
author | lokher <lokher@gmail.com> | 2023-04-26 16:32:15 +0800 |
---|---|---|
committer | lokher <lokher@gmail.com> | 2023-04-26 16:32:15 +0800 |
commit | e4f4ceaf3f2e3d25fb282273a81f9b58790fc427 (patch) | |
tree | c0a257eab0ffe5238fdf2c04882e8ee1fe8fc46e /.github | |
parent | 103badc87cb50db1ff3851c84331e86ba78fb681 (diff) |
merge upstream 713427c
Diffstat (limited to '.github')
-rw-r--r-- | .github/ISSUE_TEMPLATE/feature_request.yml | 5 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/other_issues.yml | 5 | ||||
-rw-r--r-- | .github/labeler.yml | 1 | ||||
-rw-r--r-- | .github/workflows/api.yml | 3 | ||||
-rw-r--r-- | .github/workflows/auto_approve.yml | 2 | ||||
-rw-r--r-- | .github/workflows/auto_tag.yml | 12 | ||||
-rw-r--r-- | .github/workflows/ci_builds.yml | 49 | ||||
-rw-r--r-- | .github/workflows/cli.yml | 7 | ||||
-rw-r--r-- | .github/workflows/develop_update.yml | 3 | ||||
-rw-r--r-- | .github/workflows/docs.yml | 3 | ||||
-rw-r--r-- | .github/workflows/feature_branch_update.yml | 3 | ||||
-rw-r--r-- | .github/workflows/format.yml | 14 | ||||
-rw-r--r-- | .github/workflows/format_push.yml | 6 | ||||
-rw-r--r-- | .github/workflows/labeler.yml | 4 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 26 | ||||
-rw-r--r-- | .github/workflows/regen.yml | 36 | ||||
-rw-r--r-- | .github/workflows/regen_push.yml | 46 | ||||
-rw-r--r-- | .github/workflows/stale.yml | 11 | ||||
-rw-r--r-- | .github/workflows/unit_test.yml | 3 |
19 files changed, 218 insertions, 21 deletions
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 585bcf2e6f..fdb32f098d 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -7,6 +7,9 @@ body: attributes: value: | Provide a general summary of the changes you want in the title above. + + Please refrain from asking maintainers to add support for specific keyboards -- it is unlikely they will have hardware available, and will not be able to help. + Your best bet is to take the initiative, add support, then submit a PR yourself. - type: checkboxes attributes: label: Feature Request Type @@ -18,4 +21,4 @@ body: - type: textarea attributes: label: Description - description: A few sentences describing what it is that you'd like to see in QMK. Additional information (such as links to spec sheets, licensing info, other related issues or PRs, etc) would be helpful.
\ No newline at end of file + description: A few sentences describing what it is that you'd like to see in QMK. Additional information (such as links to spec sheets, licensing info, other related issues or PRs, etc) would be helpful. diff --git a/.github/ISSUE_TEMPLATE/other_issues.yml b/.github/ISSUE_TEMPLATE/other_issues.yml index 7c4fbeb23c..d3a890e45d 100644 --- a/.github/ISSUE_TEMPLATE/other_issues.yml +++ b/.github/ISSUE_TEMPLATE/other_issues.yml @@ -10,7 +10,10 @@ body: attributes: value: | Please check [https://docs.qmk.fm/#/support](https://docs.qmk.fm/#/support) for additional resources first. If that doesn't answer your question, choose the bug report template instead, as that may be more appropriate. + + Please refrain from asking maintainers to add support for specific keyboards -- it is unlikely they will have hardware available, and will not be able to help. + Your best bet is to take the initiative, add support, then submit a PR yourself. - type: textarea attributes: label: Issue Description - description: Describe your issue in as much detail as possible.
\ No newline at end of file + description: Describe your issue in as much detail as possible. diff --git a/.github/labeler.yml b/.github/labeler.yml index 41b2475f67..07a6c451cf 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -5,6 +5,7 @@ core: - tests/**/* - util/**/* - platforms/**/* + - builddefs/**/* - Makefile - '*.mk' dependencies: diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml index 0cff4f6e75..2abfe696fd 100644 --- a/.github/workflows/api.yml +++ b/.github/workflows/api.yml @@ -1,5 +1,8 @@ name: Update API Data +permissions: + contents: read + on: push: branches: diff --git a/.github/workflows/auto_approve.yml b/.github/workflows/auto_approve.yml index dea3f017dd..1db1c49a9b 100644 --- a/.github/workflows/auto_approve.yml +++ b/.github/workflows/auto_approve.yml @@ -1,5 +1,7 @@ name: Automatic Approve +permissions: {} + on: schedule: - cron: "*/5 * * * *" diff --git a/.github/workflows/auto_tag.yml b/.github/workflows/auto_tag.yml index 0799767e5f..07490a0464 100644 --- a/.github/workflows/auto_tag.yml +++ b/.github/workflows/auto_tag.yml @@ -1,16 +1,20 @@ name: Essential files modified +permissions: + contents: write + on: push: branches: - master paths: - - quantum/**/* - - tmk_core/**/* + - builddefs/**/* - drivers/**/* + - platforms/**/* + - quantum/**/* - tests/**/* + - tmk_core/**/* - util/**/* - - platforms/**/* - Makefile - '*.mk' @@ -27,7 +31,7 @@ jobs: fetch-depth: 0 - name: Bump version and push tag - uses: anothrNick/github-tag-action@1.53.0 + uses: anothrNick/github-tag-action@1.61.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DEFAULT_BUMP: 'patch' diff --git a/.github/workflows/ci_builds.yml b/.github/workflows/ci_builds.yml new file mode 100644 index 0000000000..e2bbd93497 --- /dev/null +++ b/.github/workflows/ci_builds.yml @@ -0,0 +1,49 @@ +name: CI Builds + +permissions: + contents: read + +on: + push: + branches: + - master + - develop + +jobs: + ci_builds: + name: "CI Build" + runs-on: self-hosted + timeout-minutes: 1380 + + if: github.repository == 'qmk/qmk_firmware' + + 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] + + container: qmkfm/qmk_cli + + steps: + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install dependencies + run: pip3 install -r requirements.txt + + - 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: binaries-${{ matrix.keyboard_folder }}-${{ matrix.keymap }} + if-no-files-found: ignore + path: | + *.bin + *.hex + *.uf2 diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 72f2ea293a..d98692e6d9 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -1,5 +1,8 @@ name: CLI CI +permissions: + contents: read + on: push: branches: @@ -18,9 +21,13 @@ jobs: container: qmkfm/qmk_cli steps: + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + - uses: actions/checkout@v3 with: submodules: recursive + - name: Install dependencies run: pip3 install -r requirements-dev.txt - name: Run tests diff --git a/.github/workflows/develop_update.yml b/.github/workflows/develop_update.yml index 18ca84162b..9c041c42ec 100644 --- a/.github/workflows/develop_update.yml +++ b/.github/workflows/develop_update.yml @@ -1,5 +1,8 @@ name: Update develop after master merge +permissions: + contents: write + on: push: branches: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1497739a0b..841573cf30 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,5 +1,8 @@ name: Generate Docs +permissions: + contents: write + on: push: branches: diff --git a/.github/workflows/feature_branch_update.yml b/.github/workflows/feature_branch_update.yml index 90cd85e355..bfc4c7d65e 100644 --- a/.github/workflows/feature_branch_update.yml +++ b/.github/workflows/feature_branch_update.yml @@ -1,5 +1,8 @@ name: Update feature branches after develop merge +permissions: + contents: write + on: push: branches: diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index b6ce4063fe..78aaae8a0e 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -1,5 +1,8 @@ name: PR Lint Format +permissions: + contents: read + on: pull_request: paths: @@ -19,6 +22,9 @@ jobs: container: qmkfm/qmk_cli steps: + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -27,16 +33,14 @@ jobs: run: | pip3 install -r requirements-dev.txt - - uses: trilom/file-changes-action@v1.2.4 + - name: Get changed files id: file_changes - with: - output: ' ' - fileOutput: ' ' + uses: tj-actions/changed-files@v35 - name: Run qmk formatters shell: 'bash {0}' run: | - cat ~/files_added.txt ~/files_modified.txt > ~/files_changed.txt + echo '${{ steps.file_changes.outputs.added_files}}' '${{ steps.file_changes.outputs.modified_files}}' > ~/files_changed.txt qmk format-c --core-only $(< ~/files_changed.txt) || true qmk format-python $(< ~/files_changed.txt) || true qmk format-text $(< ~/files_changed.txt) || true diff --git a/.github/workflows/format_push.yml b/.github/workflows/format_push.yml index 910bba9a4e..26e9f4edfb 100644 --- a/.github/workflows/format_push.yml +++ b/.github/workflows/format_push.yml @@ -1,5 +1,8 @@ name: Lint Format +permissions: + contents: read + on: push: branches: @@ -13,6 +16,9 @@ jobs: container: qmkfm/qmk_cli steps: + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + - uses: actions/checkout@v3 with: fetch-depth: 0 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 3b99a8f43e..95f58ff003 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,5 +1,9 @@ name: "Pull Request Labeler" +permissions: + contents: read + pull-requests: write + on: pull_request_target: types: [opened, synchronize, reopened, ready_for_review, locked] diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5b8a45f26b..6b4e266bde 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,5 +1,8 @@ name: PR Lint keyboards +permissions: + contents: read + on: pull_request: paths: @@ -12,6 +15,9 @@ jobs: container: qmkfm/qmk_cli steps: + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -19,24 +25,24 @@ jobs: - name: Install dependencies run: pip3 install -r requirements-dev.txt - - uses: trilom/file-changes-action@v1.2.4 + - name: Get changed files id: file_changes - with: - output: '\n' + uses: tj-actions/changed-files@v35 - name: Print info run: | git rev-parse --short HEAD echo ${{ github.event.pull_request.base.sha }} - echo '${{ steps.file_changes.outputs.files}}' + echo '${{ steps.file_changes.outputs.all_changed_files}}' - name: Run qmk lint shell: 'bash {0}' run: | - QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.files}}') + QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.all_changed_files}}' | sed 's/ /\n/g') QMK_KEYBOARDS=$(qmk list-keyboards) exit_code=0 + for KB in $QMK_KEYBOARDS; do KEYBOARD_CHANGES=$(echo "$QMK_CHANGES" | grep -E '^(keyboards/'${KB}'/)') if [[ -z "$KEYBOARD_CHANGES" ]]; then @@ -52,6 +58,16 @@ jobs: exit_code=$(($exit_code + $?)) fi done + + qmk format-text ${{ steps.file_changes.outputs.all_changed_files}} || true + for file in ${{ steps.file_changes.outputs.all_changed_files}}; do + if ! git diff --quiet $file; then + echo "File '${file}' Requires Formatting" + echo "::error file=${file}::Requires Formatting" + exit_code=$(($exit_code + 1)) + fi + done + if [[ $exit_code -gt 255 ]]; then exit 255 fi diff --git a/.github/workflows/regen.yml b/.github/workflows/regen.yml new file mode 100644 index 0000000000..f301000d55 --- /dev/null +++ b/.github/workflows/regen.yml @@ -0,0 +1,36 @@ +name: PR Regenerate Files + +permissions: + contents: read + +on: + pull_request: + paths: + - 'data/constants/**' + - 'lib/python/**' + +jobs: + regen: + runs-on: ubuntu-latest + + container: qmkfm/qmk_cli + + steps: + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + + - uses: actions/checkout@v3 + + - name: Run qmk generators + run: | + util/regen.sh + git diff + + - name: Fail when regeneration required + run: | + git diff + for file in $(git diff --name-only); do + echo "File '${file}' Requires Regeneration" + echo "::error file=${file}::Requires Regeneration" + done + test -z "$(git diff --name-only)" diff --git a/.github/workflows/regen_push.yml b/.github/workflows/regen_push.yml new file mode 100644 index 0000000000..c56bc48a69 --- /dev/null +++ b/.github/workflows/regen_push.yml @@ -0,0 +1,46 @@ +name: Regenerate Files + +permissions: + contents: write + +on: + push: + branches: + - master + - develop + +jobs: + regen: + runs-on: ubuntu-latest + + container: qmkfm/qmk_cli + + steps: + - name: Disable safe.directory check + run : git config --global --add safe.directory '*' + + - uses: actions/checkout@v3 + + - name: Run qmk generators + run: | + util/regen.sh + git diff + + - uses: rlespinasse/github-slug-action@v3.x + + - name: Become QMK Bot + run: | + git config user.name 'QMK Bot' + git config user.email 'hello@qmk.fm' + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + if: ${{ github.repository == 'qmk/qmk_firmware'}} + with: + token: ${{ secrets.QMK_BOT_TOKEN }} + delete-branch: true + branch: bugfix/regen_${{ env.GITHUB_REF_SLUG }} + author: QMK Bot <hello@qmk.fm> + committer: QMK Bot <hello@qmk.fm> + commit-message: Regenerate Files + title: '[CI] Regenerate Files' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 297af8e19c..89c2bd5f67 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,18 +1,19 @@ name: 'Close stale issues and PRs' -on: - schedule: - - cron: '30 1 * * *' - workflow_dispatch: permissions: issues: write pull-requests: write +on: + schedule: + - cron: '30 1 * * *' + workflow_dispatch: + jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v6 + - uses: actions/stale@v7 with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml index c8373441ff..75ed84177b 100644 --- a/.github/workflows/unit_test.yml +++ b/.github/workflows/unit_test.yml @@ -1,5 +1,8 @@ name: Unit Tests +permissions: + contents: read + on: push: branches: |