Ver Fonte

feat(ci): separate lint and unit test workflows

alvarosabu há 2 anos atrás
pai
commit
627495dae0
2 ficheiros alterados com 45 adições e 4 exclusões
  1. 41 0
      .github/workflows/lint.yml
  2. 4 4
      .github/workflows/test.yml

+ 41 - 0
.github/workflows/lint.yml

@@ -0,0 +1,41 @@
+name: Run linters
+on: [push]
+
+env:
+  PNPM_CACHE_FOLDER: .pnpm-store
+  HUSKY: 0 # Bypass husky commit hook for CI
+
+jobs:
+  lint:
+    name: Lint all projects
+    runs-on: ubuntu-20.04
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      - name: setup caching
+        uses: actions/cache@v2
+        with:
+          path: ${{ env.PNPM_CACHE_FOLDER }}
+          key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
+          restore-keys: |
+            ${{ runner.os }}-pnpm-
+
+      - name: setup pnpm
+        uses: pnpm/action-setup@v2.2.4
+        with:
+          version: 7
+
+      - name: setup node.js
+        uses: actions/setup-node@v2
+        with:
+          node-version: 16.x
+          cache: 'pnpm'
+
+      - name: setup pnpm config
+        run: pnpm config set store-dir $PNPM_CACHE_FOLDER
+
+      - run: pnpm install --no-frozen-lockfile --shamefully-hoist
+
+      - name: Run Lint
+        run: pnpm run lint

+ 4 - 4
.github/workflows/test.yml

@@ -1,4 +1,4 @@
-name: Run linters
+name: Run unit tests
 on: [push]
 on: [push]
 
 
 env:
 env:
@@ -7,7 +7,7 @@ env:
 
 
 jobs:
 jobs:
   lint:
   lint:
-    name: Lint all projects
+    name: Run Unit Tests
     runs-on: ubuntu-20.04
     runs-on: ubuntu-20.04
     steps:
     steps:
       - name: Checkout
       - name: Checkout
@@ -37,5 +37,5 @@ jobs:
 
 
       - run: pnpm install --no-frozen-lockfile --shamefully-hoist
       - run: pnpm install --no-frozen-lockfile --shamefully-hoist
 
 
-      - name: Run Lint
-        run: pnpm run lint
+      - name: Run Tests
+        run: pnpm run test