2021-08-19 12:27:01 +00:00
|
|
|
name: Lint
|
2022-01-13 18:09:37 +00:00
|
|
|
on:
|
2022-11-03 20:29:14 +00:00
|
|
|
pull_request_target:
|
2022-01-13 18:09:37 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2022-07-05 01:13:51 +00:00
|
|
|
paths:
|
2022-07-12 00:27:24 +00:00
|
|
|
- "**.tsx?"
|
|
|
|
- "**.jsx?"
|
2022-09-08 17:01:47 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
2021-08-19 12:27:01 +00:00
|
|
|
jobs:
|
|
|
|
lint:
|
2022-07-12 00:27:24 +00:00
|
|
|
runs-on: ubuntu-latest
|
2021-08-19 12:27:01 +00:00
|
|
|
|
|
|
|
steps:
|
2022-03-22 14:52:47 +00:00
|
|
|
- name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
2021-08-19 12:27:01 +00:00
|
|
|
with:
|
2022-03-28 19:21:31 +00:00
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
fetch-depth: 2
|
2021-08-19 12:27:01 +00:00
|
|
|
|
2022-07-12 00:27:24 +00:00
|
|
|
- name: Use Node 16.x
|
2022-05-18 04:30:16 +00:00
|
|
|
uses: actions/setup-node@v3
|
2021-08-19 12:27:01 +00:00
|
|
|
with:
|
2022-07-12 00:27:24 +00:00
|
|
|
node-version: 16.x
|
2022-05-18 04:30:16 +00:00
|
|
|
cache: "yarn"
|
2021-08-19 12:27:01 +00:00
|
|
|
|
|
|
|
- name: Install deps
|
2022-03-09 17:52:48 +00:00
|
|
|
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
2022-05-18 04:30:16 +00:00
|
|
|
run: yarn --frozen-lockfile
|
2021-08-19 12:27:01 +00:00
|
|
|
|
2022-11-07 21:12:12 +00:00
|
|
|
- name: Test Code Linting
|
|
|
|
run: yarn lint
|
|
|
|
|
|
|
|
- name: Save Code Linting Reports
|
2022-03-09 17:52:48 +00:00
|
|
|
run: yarn lint:report
|
|
|
|
continue-on-error: true
|
|
|
|
|
|
|
|
- name: Merge lint reports
|
|
|
|
run: jq -s '[.[]]|flatten' lint-results/*.json &> lint-results/eslint_report.json
|
|
|
|
|
|
|
|
- name: Annotate Code Linting Results
|
2022-07-12 20:15:06 +00:00
|
|
|
uses: ataylorme/eslint-annotate-action@v2
|
2022-03-09 17:52:48 +00:00
|
|
|
with:
|
2022-07-12 20:05:15 +00:00
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-03-09 17:52:48 +00:00
|
|
|
report-json: "lint-results/eslint_report.json"
|
2022-07-12 20:05:15 +00:00
|
|
|
only-pr-files: false
|
2022-03-09 17:52:48 +00:00
|
|
|
|
|
|
|
- name: Upload ESLint report
|
|
|
|
if: ${{ always() }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: lint-results
|
|
|
|
path: lint-results
|