33483cba94
* Test: Rename a used prop * Use `github-check` reporter * Also output to CI * Update validate-js.yml * Update validate-js.yml * Update validate-js.yml * Revert "Test: Rename a used prop" This reverts commit 266b2716ea591a1e826279c1f573870bee3b13e5. * Run tsc and lint in parallel * Flatten `CameraProps` into single `interface` * Type NativeCameraViewProps * Fix native method typings * Force `as any` for now
78 lines
2.0 KiB
YAML
78 lines
2.0 KiB
YAML
name: Validate JS
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '.github/workflows/validate-js.yml'
|
|
- 'src/**'
|
|
- '*.json'
|
|
- '*.js'
|
|
- '*.lock'
|
|
pull_request:
|
|
paths:
|
|
- '.github/workflows/validate-js.yml'
|
|
- 'src/**'
|
|
- '*.json'
|
|
- '*.js'
|
|
- '*.lock'
|
|
|
|
jobs:
|
|
compile:
|
|
name: Compile JS (tsc)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
- name: Restore node_modules from cache
|
|
uses: actions/cache@v2
|
|
id: yarn-cache
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Install node_modules
|
|
run: yarn install --frozen-lockfile
|
|
- name: Install node_modules (example/)
|
|
run: yarn install --frozen-lockfile --cwd example
|
|
|
|
- name: Run TypeScript
|
|
uses: ypresto/typescript-error-reporter-action@6cb6a970f0783c19f55fb83079f7846a583c7543
|
|
|
|
lint:
|
|
name: Lint JS (eslint, prettier)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
- name: Restore node_modules from cache
|
|
uses: actions/cache@v2
|
|
id: yarn-cache
|
|
with:
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-yarn-
|
|
|
|
- name: Install node_modules
|
|
run: yarn install --frozen-lockfile
|
|
- name: Install node_modules (example/)
|
|
run: yarn install --frozen-lockfile --cwd example
|
|
|
|
- name: Run ESLint
|
|
uses: reviewdog/action-eslint@v1
|
|
with:
|
|
reporter: github-pr-review
|
|
eslint_flags: '--ext .js,.ts,.jsx,.tsx src'
|
|
fail_on_error: true
|
|
filter_mode: nofilter
|