diff options
| author | Zach White <skullydazed@gmail.com> | 2021-05-10 11:18:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-10 11:18:44 -0700 |
| commit | a3e7f3e7c58ee98596ead5c213f3a9ed8340cd80 (patch) | |
| tree | ef0cb85205fad7562045f23caa8a16384e43bbb5 /.github/workflows | |
| parent | 66ed80ad3a0edecd9d7abbef71fc2a6e3e59b541 (diff) | |
| download | qmk_firmware-a3e7f3e7c58ee98596ead5c213f3a9ed8340cd80.tar.gz qmk_firmware-a3e7f3e7c58ee98596ead5c213f3a9ed8340cd80.zip | |
Improve our CI tests (#11476)
* add a test and dry-run to qmk generate-api
* add a dry-run to qmk pyformat
* Add a --dry-run to qmk cformat
* reverse the order of nose2 and flake8 tests
* run CI test against cformat and pyformat
* fix programming errors
* tweak job name
* fix argument
* refine the files we select
* fix stack trace in --ci
* make cformat exit clean
* fix c file extensions
* decouple CI from pyformat
* remove --ci arg
* make ci happy
* use the environment var instead
* change output to text
* fix log message
* replace tabs
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/format.yaml | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml index 201f3c230..6d13e7894 100644 --- a/.github/workflows/format.yaml +++ b/.github/workflows/format.yaml | |||
| @@ -1,47 +1,42 @@ | |||
| 1 | name: Format Codebase | 1 | name: PR Lint Format |
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | pull_request: |
| 5 | branches: | 5 | paths: |
| 6 | - master | 6 | - 'drivers/**' |
| 7 | - develop | 7 | - 'lib/arm_atsam/**' |
| 8 | - 'lib/lib8tion/**' | ||
| 9 | - 'lib/python/**' | ||
| 10 | - 'platforms/**' | ||
| 11 | - 'quantum/**' | ||
| 12 | - 'tests/**' | ||
| 13 | - 'tmk_core/**' | ||
| 8 | 14 | ||
| 9 | jobs: | 15 | jobs: |
| 10 | format: | 16 | lint: |
| 11 | runs-on: ubuntu-latest | 17 | runs-on: ubuntu-latest |
| 12 | container: qmkfm/base_container | ||
| 13 | 18 | ||
| 14 | # protect against those who develop with their fork on master | 19 | container: qmkfm/base_container |
| 15 | if: github.repository == 'qmk/qmk_firmware' | ||
| 16 | 20 | ||
| 17 | steps: | 21 | steps: |
| 18 | - uses: rlespinasse/github-slug-action@v3.x | 22 | - uses: rlespinasse/github-slug-action@v3.x |
| 19 | 23 | ||
| 20 | - uses: actions/checkout@v2 | 24 | - uses: actions/checkout@v2 |
| 21 | with: | 25 | with: |
| 22 | token: ${{ secrets.API_TOKEN_GITHUB }} | 26 | fetch-depth: 0 |
| 23 | |||
| 24 | - name: Install dependencies | ||
| 25 | run: | | ||
| 26 | apt-get update && apt-get install -y dos2unix | ||
| 27 | 27 | ||
| 28 | - name: Format files | 28 | - uses: trilom/file-changes-action@v1.2.4 |
| 29 | run: | | 29 | id: file_changes |
| 30 | bin/qmk cformat -a | 30 | with: |
| 31 | bin/qmk pyformat | 31 | output: ' ' |
| 32 | bin/qmk fileformat | 32 | fileOutput: ' ' |
| 33 | 33 | ||
| 34 | - name: Become QMK Bot | 34 | - name: Run qmk cformat and qmk pyformat |
| 35 | shell: 'bash {0}' | ||
| 35 | run: | | 36 | run: | |
| 36 | git config user.name 'QMK Bot' | 37 | qmk cformat -n $(< ~/files.txt) |
| 37 | git config user.email 'hello@qmk.fm' | 38 | cformat_exit=$? |
| 39 | qmk pyformat -n | ||
| 40 | pyformat_exit=$? | ||
| 38 | 41 | ||
| 39 | - name: Create Pull Request | 42 | exit $((cformat_exit + pyformat_exit)) |
| 40 | uses: peter-evans/create-pull-request@v3 | ||
| 41 | with: | ||
| 42 | delete-branch: true | ||
| 43 | branch: bugfix/format_${{ env.GITHUB_REF_SLUG }} | ||
| 44 | author: QMK Bot <hello@qmk.fm> | ||
| 45 | committer: QMK Bot <hello@qmk.fm> | ||
| 46 | commit-message: Format code according to conventions | ||
| 47 | title: '[CI] Format code according to conventions' | ||
