Devops/reviewdog typescript (#25)

* Use reviewdog for TSC

* Replace all `type Readonly<T>` with `interface T`

* Use --frozen-lockfile for yarn

* Give all actions a name

* Fix yarn example
This commit is contained in:
Marc Rousavy
2021-03-08 17:51:47 +01:00
committed by GitHub
parent 4e5a79fbde
commit f051481010
9 changed files with 131 additions and 104 deletions

View File

@@ -52,9 +52,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Add key to allow access to repository
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
@@ -72,7 +70,8 @@ jobs:
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
- name: Restore node_modules from cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

View File

@@ -27,11 +27,35 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Setup node_modules
run: yarn --cwd ..
- 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 --cwd ..
- name: Restore Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Lint
run: ./gradlew lint
- uses: yutailang0119/action-android-lint@v1.0.2
- name: Parse Gradle Lint Report
uses: yutailang0119/action-android-lint@v1.0.2
with:
xml_path: android/build/reports/lint-results.xml
ktlint:

View File

@@ -33,10 +33,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install reviewdog
uses: reviewdog/action-setup@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
- name: Restore node_modules from cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -44,13 +48,18 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Install modules
run: yarn
- name: Install modules (example/)
run: yarn example
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Install node_modules (example/)
run: yarn install --frozen-lockfile --cwd example
- name: Run TypeScript
run: yarn typescript
run: yarn typescript | reviewdog -f=tsc -reporter=github-pr-review
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run ESLint
run: yarn lint-ci
uses: reviewdog/action-eslint@v1
with:
reporter: github-pr-review
eslint_flags: '--ext .js,.ts,.jsx,.tsx src'