diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/api.yml | 37 | ||||
-rw-r--r-- | .github/workflows/auto_tag.yaml | 33 | ||||
-rw-r--r-- | .github/workflows/cli.yml | 28 | ||||
-rw-r--r-- | .github/workflows/develop_api.yml | 37 | ||||
-rw-r--r-- | .github/workflows/develop_update.yml | 37 | ||||
-rw-r--r-- | .github/workflows/docs.yml | 43 | ||||
-rw-r--r-- | .github/workflows/format.yaml | 42 | ||||
-rw-r--r-- | .github/workflows/labeler.yml | 14 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 55 |
9 files changed, 326 insertions, 0 deletions
diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml new file mode 100644 index 0000000000..c8d988d0f0 --- /dev/null +++ b/.github/workflows/api.yml @@ -0,0 +1,37 @@ +name: Update API Data + +on: + push: + branches: + - master + paths: + - 'keyboards/**' + - 'layouts/community/**' + +jobs: + api_data: + runs-on: ubuntu-latest + container: qmkfm/base_container + + # protect against those who develop with their fork on master + if: github.repository == 'qmk/qmk_firmware' + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + persist-credentials: false + + - name: Generate API Data + run: qmk generate-api + + - name: Upload API Data + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ secrets.API_SPACE_MASTER }} + AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_KEY }} + AWS_S3_ENDPOINT: https://nyc3.digitaloceanspaces.com + SOURCE_DIR: 'api_data' diff --git a/.github/workflows/auto_tag.yaml b/.github/workflows/auto_tag.yaml new file mode 100644 index 0000000000..29e85c41ca --- /dev/null +++ b/.github/workflows/auto_tag.yaml @@ -0,0 +1,33 @@ +name: Essential files modified + +on: + push: + branches: + - master + paths: + - quantum/**/* + - tmk_core/**/* + - drivers/**/* + - tests/**/* + - util/**/* + - platforms/**/* + - Makefile + - '*.mk' + +jobs: + tag: + runs-on: ubuntu-latest + + # protect against those who develop with their fork on master + if: github.repository == 'qmk/qmk_firmware' + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Bump version and push tag + uses: anothrNick/github-tag-action@1.26.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DEFAULT_BUMP: 'patch' diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml new file mode 100644 index 0000000000..28c6bb3679 --- /dev/null +++ b/.github/workflows/cli.yml @@ -0,0 +1,28 @@ +name: CLI CI + +on: + push: + branches: + - master + - future + pull_request: + paths: + - 'lib/python/**' + - 'bin/qmk' + - 'requirements.txt' + - '.github/workflows/cli.yml' + +jobs: + test: + runs-on: ubuntu-latest + + container: qmkfm/base_container + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Install dependencies + run: pip3 install -r requirements.txt + - name: Run tests + run: bin/qmk pytest diff --git a/.github/workflows/develop_api.yml b/.github/workflows/develop_api.yml new file mode 100644 index 0000000000..4e64cbcf8c --- /dev/null +++ b/.github/workflows/develop_api.yml @@ -0,0 +1,37 @@ +name: Update Develop API Data + +on: + push: + branches: + - develop + paths: + - 'keyboards/**' + - 'layouts/community/**' + +jobs: + api_data: + runs-on: ubuntu-latest + container: qmkfm/base_container + + # protect against those who work in their fork on develop + if: github.repository == 'qmk/qmk_firmware' + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + persist-credentials: false + + - name: Generate API Data + run: qmk generate-api + + - name: Upload API Data + uses: jakejarvis/s3-sync-action@master + with: + args: --acl public-read --follow-symlinks --delete + env: + AWS_S3_BUCKET: ${{ secrets.API_SPACE_DEVELOP }} + AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_KEY }} + AWS_S3_ENDPOINT: https://nyc3.digitaloceanspaces.com + SOURCE_DIR: 'api_data' diff --git a/.github/workflows/develop_update.yml b/.github/workflows/develop_update.yml new file mode 100644 index 0000000000..285720fefe --- /dev/null +++ b/.github/workflows/develop_update.yml @@ -0,0 +1,37 @@ +name: Update develop after master merge + +on: + push: + branches: + - master + + +jobs: + develop_update: + runs-on: ubuntu-latest + + if: github.repository == 'qmk/qmk_firmware' + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Checkout develop + run: | + git fetch origin master develop + git checkout develop + + - name: Check if branch locked + id: check_locked + uses: andstor/file-existence-action@v1 + with: + files: ".locked" + + - name: Update develop from master + if: steps.check_locked.outputs.files_exists == 'false' + run: | + git config --global user.name "QMK Bot" + git config --global user.email "hello@qmk.fm" + git merge origin/master + git push origin develop diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000000..8855d1107f --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,43 @@ +name: Generate Docs + +on: + push: + branches: + - master + paths: + - 'tmk_core/**' + - 'quantum/**' + - 'platforms/**' + - 'docs/**' + - '.github/workflows/docs.yml' + +jobs: + generate: + runs-on: ubuntu-latest + container: qmkfm/base_container + + # protect against those who develop with their fork on master + if: github.repository == 'qmk/qmk_firmware' + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Install dependencies + run: | + apt-get update && apt-get install -y rsync nodejs npm doxygen + npm install -g moxygen + + - name: Build docs + run: | + qmk --verbose generate-docs + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BASE_BRANCH: master + BRANCH: gh-pages + FOLDER: .build/docs + GIT_CONFIG_EMAIL: hello@qmk.fm diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 0000000000..c17a04a542 --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,42 @@ +name: PR Lint Format + +on: + pull_request: + paths: + - 'drivers/**' + - 'lib/arm_atsam/**' + - 'lib/lib8tion/**' + - 'lib/python/**' + - 'platforms/**' + - 'quantum/**' + - 'tests/**' + - 'tmk_core/**' + +jobs: + lint: + runs-on: ubuntu-latest + + container: qmkfm/base_container + + steps: + - uses: rlespinasse/github-slug-action@v3.x + + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: trilom/file-changes-action@v1.2.4 + id: file_changes + with: + output: ' ' + fileOutput: ' ' + + - name: Run qmk cformat and qmk pyformat + shell: 'bash {0}' + run: | + qmk cformat --core-only -n $(< ~/files.txt) + cformat_exit=$? + qmk pyformat -n + pyformat_exit=$? + + exit $((cformat_exit + pyformat_exit)) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000..3b99a8f43e --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,14 @@ +name: "Pull Request Labeler" + +on: + pull_request_target: + types: [opened, synchronize, reopened, ready_for_review, locked] + +jobs: + triage: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@main + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: '.github/labeler.yml' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..cd67de9d8b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,55 @@ +name: PR Lint keyboards + +on: + pull_request: + paths: + - 'keyboards/**' + +jobs: + lint: + runs-on: ubuntu-latest + + container: qmkfm/base_container + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - uses: trilom/file-changes-action@v1.2.4 + id: file_changes + with: + output: '\n' + + - name: Print info + run: | + git rev-parse --short HEAD + echo ${{ github.event.pull_request.base.sha }} + echo '${{ steps.file_changes.outputs.files}}' + + - name: Run qmk lint + shell: 'bash {0}' + run: | + QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.files}}') + 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 + # skip as no changes for this keyboard + continue + fi + + KEYMAP_ONLY=$(echo "$KEYBOARD_CHANGES" | grep -cv /keymaps/) + if [[ $KEYMAP_ONLY -gt 0 ]]; then + echo "linting ${KB}" + + qmk lint --keyboard ${KB} && qmk info -l --keyboard ${KB} + exit_code=$(($exit_code + $?)) + fi + done + if [[ $exit_code -gt 255 ]]; then + exit 255 + fi + exit $exit_code |