⬆️: Update Tools (major) #323
This file contains 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: App | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'Doodle/**/*.js' | |
- 'Doodle/**/*.jsx' | |
- 'Doodle/**/*.ts' | |
- 'Doodle/**/*.tsx' | |
- 'Doodle/@app/**' | |
- 'Doodle/__jest__/**' | |
- 'Doodle/.eslintrc.js' | |
- 'Doodle/.prettierrc.js' | |
- 'Doodle/babel.config.js' | |
- 'Doodle/index.js' | |
- 'Doodle/metro.config.js' | |
- 'Doodle/package.json' | |
- 'Doodle/package-lock.json' | |
- 'Doodle/tsconfig.json' | |
- '.editorconfig' | |
- '.github/workflows/app.yaml' | |
types: | |
- opened | |
- synchronize | |
- reopened | |
jobs: | |
lint-and-test: | |
name: Run lint and test | |
runs-on: ubuntu-latest | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# Cache '.npm' to speed up clean-install when package-lock.json is updated. | |
# Loosened up the restore-keys a bit, as it doesn't have to match the contents of package-lock.json exactly. | |
- name: Cache .npm | |
id: cache-npm | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
# If cache is corrupted, increment prefixed number. | |
key: 1-${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
1-${{ runner.os }}-npm- | |
# If package-lock.json matches, node_modules will also match. | |
# So, cache node_modules directly to skip install step. | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v2 | |
with: | |
path: Doodle/node_modules | |
# If cache is corrupted, increment prefixed number. | |
key: 1-${{ runner.os }}-Doodle-node-modules-${{ hashFiles('Doodle/**/package-lock.json') }} | |
# node_modulesがキャッシュから復元されなかった場合は、依存ライブラリをインストールします。 | |
- name: Install dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm clean-install --prefix=Doodle | |
- name: Set up reviewdog | |
uses: reviewdog/action-setup@v1 | |
with: | |
reviewdog_version: latest | |
- name: Lint (ESLint) | |
if: always() | |
run: | | |
npm run -s lint:es --prefix=Doodle | reviewdog -tee -fail-on-error -reporter=github-pr-review -f=eslint -name="ESLint" | |
- name: Lint (TypeScript) | |
if: always() | |
run: | | |
npm run -s lint:tsc --prefix=Doodle | reviewdog -tee -fail-on-error -reporter=github-pr-review -f=tsc -name="TypeScript" | |
- name: Test | |
if: always() | |
run: | | |
npm run -s test --prefix=Doodle -- --ci --reporters=default --reporters=jest-junit | |
- name: Report test result | |
uses: ashley-taylor/junit-report-annotations-action@master | |
if: always() | |
with: | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
name: Test results | |
path: Doodle/junit.xml |