chore: update github actions (#20) #26
This file contains hidden or 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
| name: Lint | |
| on: | |
| push: | |
| workflow_dispatch: | |
| concurrency: | |
| cancel-in-progress: true | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| permissions: | |
| contents: read | |
| env: | |
| CSPELL_VERSION: '9.6.4' | |
| PRETTIER_VERSION: '3.8.1' | |
| COMMITLINT_CLI_VERSION: '20.4.1' | |
| jobs: | |
| install-commitlint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - &checkout-code | |
| name: Checkout code (shallow) | |
| uses: actions/checkout@v5 | |
| - &cache-commitlint | |
| name: Cache Commitlint | |
| id: cache-commitlint | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: v4-commitlint-${{ env.COMMITLINT_CLI_VERSION }} | |
| - name: Install Commitlint | |
| if: steps.cache-commitlint.outputs.cache-hit != 'true' | |
| run: npm i -D @commitlint/cli@${{ env.COMMITLINT_CLI_VERSION }} @commitlint/config-conventional | |
| run-commitlint: | |
| runs-on: ubuntu-latest | |
| needs: install-commitlint | |
| steps: | |
| - name: Checkout code (full) | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - *cache-commitlint | |
| - name: Run commitlint | |
| run: | | |
| git checkout main | |
| git checkout - | |
| ./node_modules/.bin/commitlint --from main --to HEAD --verbose | |
| install-prettier: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - *checkout-code | |
| - &cache-prettier | |
| name: Cache Prettier | |
| id: cache-prettier | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: v1-prettier-${{ env.PRETTIER_VERSION }} | |
| - name: Install Prettier | |
| if: steps.cache-prettier.outputs.cache-hit != 'true' | |
| run: npm i -D prettier@${{ env.PRETTIER_VERSION }} | |
| run-prettier: | |
| runs-on: ubuntu-latest | |
| needs: install-prettier | |
| steps: | |
| - *checkout-code | |
| - *cache-prettier | |
| - name: Run Prettier check | |
| run: ./node_modules/.bin/prettier --check . | |
| install-cspell: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - *checkout-code | |
| - &cache-cspell | |
| name: Cache CSpell | |
| id: cache-cspell | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: v1-cspell-${{ env.CSPELL_VERSION }} | |
| - name: Install CSpell | |
| if: steps.cache-cspell.outputs.cache-hit != 'true' | |
| run: npm i -D cspell | |
| run-cspell: | |
| runs-on: ubuntu-latest | |
| needs: install-cspell | |
| steps: | |
| - *checkout-code | |
| - *cache-cspell | |
| - name: Run CSpell check | |
| run: ./node_modules/.bin/cspell |