Add Deno workflow for linting and testing #4
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: Sync code formatting | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| autofix-markdown: | |
| name: Autofix Markdown files using Prettier | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| # Fetch changes to previous commit - required for 'only_changed' in Prettier action | |
| fetch-depth: 0 | |
| - name: use node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| registry-url: https://registry.npmjs.org/ # Needed for auth | |
| - name: yarn install | |
| uses: backstage/actions/yarn-install@v0.6.4 | |
| with: | |
| cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }} | |
| - name: Run Prettier on ADOPTERS.md | |
| uses: creyD/prettier_action@v4.3 | |
| with: | |
| # Modifies commit only if prettier autofixed the ADOPTERS.md | |
| prettier_options: --config docs/prettier.config.js --write ADOPTERS.md | |
| only_changed: true | |
| commit_message: 'Autofix ADOPTERS.md using Prettier' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |