Kaynağa Gözat

ci: add autofix for pr (#9112)

三咲智子 Kevin Deng 2 yıl önce
ebeveyn
işleme
8adb2ca537

+ 33 - 0
.github/workflows/autofix.yml

@@ -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

+ 6 - 9
.github/workflows/ci.yml

@@ -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

+ 4 - 1
.github/workflows/size-data.yml

@@ -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
 

+ 4 - 1
.github/workflows/size-report.yml

@@ -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