fix TS field #81
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: Validate JS | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/validate-js.yml' | |
| - 'package/src/**' | |
| - 'package/*.json' | |
| - 'package/*.js' | |
| - 'bun.lock' | |
| - 'examples/**/*.json' | |
| - 'examples/**/*.js' | |
| - 'examples/**/*.ts' | |
| - 'examples/**/*.tsx' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/validate-js.yml' | |
| - 'package/src/**' | |
| - 'package/*.json' | |
| - 'package/*.js' | |
| - 'bun.lock' | |
| - 'examples/**/*.json' | |
| - 'examples/**/*.js' | |
| - 'examples/**/*.ts' | |
| - 'examples/**/*.tsx' | |
| jobs: | |
| compile: | |
| name: Compile JS (tsc) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install reviewdog | |
| uses: reviewdog/action-setup@v1 | |
| - name: Restore bun cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run TypeScript # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m | |
| working-directory: package | |
| run: | | |
| bun run typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Run TypeScript in example app # Reviewdog tsc errorformat: %f:%l:%c - error TS%n: %m | |
| working-directory: examples/Shared | |
| run: | | |
| bun run typescript | reviewdog -name="tsc" -efm="%f(%l,%c): error TS%n: %m" -reporter="github-pr-review" -filter-mode="nofilter" -fail-on-error -tee | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| lint: | |
| name: Lint JS (eslint, prettier) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Restore bun cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run ESLint | |
| working-directory: package | |
| run: bun run lint -f @jamesacarr/github-actions | |
| - name: Run ESLint with auto-fix | |
| working-directory: package | |
| run: bun run lint --fix | |
| - name: Run ESLint in example app | |
| working-directory: examples/AppExampleFabric | |
| run: bun run lint -f @jamesacarr/github-actions | |
| - name: Run ESLint in example app with auto-fix | |
| working-directory: examples/AppExampleFabric | |
| run: bun run lint --fix | |
| - name: Verify no files have changed after auto-fix | |
| run: git diff --exit-code HEAD |