ci: add autofix for pr (#9112)

This commit is contained in:
三咲智子 Kevin Deng 2023-09-05 02:22:39 -05:00 committed by GitHub
parent 8f311c6f82
commit 8adb2ca537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 11 deletions

33
.github/workflows/autofix.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: autofix.ci
on:
pull_request:
permissions:
contents: read
jobs:
autofix:
runs-on: ubuntu-latest
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
- name: Set node version to 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- run: pnpm install
- name: Run eslint
run: pnpm run lint --fix
- name: Run prettier
run: pnpm run format
- uses: autofix-ci/action@8caa572fd27b0019a65e4c695447089c8d3138b9

View File

@ -14,6 +14,8 @@ jobs:
unit-test:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v3
@ -26,9 +28,6 @@ jobs:
node-version: 18
cache: 'pnpm'
- name: Skip Puppeteer download
run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
- run: pnpm install
- name: Run unit tests
@ -37,6 +36,8 @@ jobs:
unit-test-windows:
runs-on: windows-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v3
@ -49,9 +50,6 @@ jobs:
node-version: 18
cache: 'pnpm'
- name: Skip Puppeteer download
run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $env:GITHUB_ENV
- run: pnpm install
- name: Run compiler unit tests
@ -89,6 +87,8 @@ jobs:
lint-and-test-dts:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
steps:
- uses: actions/checkout@v3
@ -101,9 +101,6 @@ jobs:
node-version: 18
cache: 'pnpm'
- name: Skip Puppeteer download
run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
- run: pnpm install
- name: Run eslint

View File

@ -11,6 +11,9 @@ on:
permissions:
contents: read
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
jobs:
upload:
runs-on: ubuntu-latest
@ -28,7 +31,7 @@ jobs:
cache: pnpm
- name: Install dependencies
run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
run: pnpm install
- run: pnpm run size

View File

@ -11,6 +11,9 @@ permissions:
pull-requests: write
issues: write
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
jobs:
size-report:
runs-on: ubuntu-latest
@ -30,7 +33,7 @@ jobs:
cache: pnpm
- name: Install dependencies
run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
run: pnpm install
- name: Download PR number
uses: dawidd6/action-download-artifact@v2