From 6be03b681e330054d8a7ea6d8348c8ae13285528 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Fri, 18 Aug 2023 17:06:52 -0400 Subject: [PATCH] [ci] Split out babel-plugin-react-forget jest to its own job --- compiler/.github/workflows/typescript.yml | 29 +++++++++++++++++-- .../babel-plugin-react-forget/package.json | 2 +- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/compiler/.github/workflows/typescript.yml b/compiler/.github/workflows/typescript.yml index a4e18bb554..b67f0b8cf4 100644 --- a/compiler/.github/workflows/typescript.yml +++ b/compiler/.github/workflows/typescript.yml @@ -7,6 +7,7 @@ on: jobs: discover_yarn_workspaces: + name: Discover yarn workspaces runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -15,6 +16,7 @@ jobs: - id: set-matrix run: echo "matrix=$(find forget/packages -mindepth 1 -maxdepth 1 -type d | sed 's!forget/packages/!!g' | tr '\n' ',' | sed s/.$// | jq -Rsc '. / "," - [""]')" >> $GITHUB_OUTPUT + # Hardcoded to improve parallelism for babel-plugin-react-forget lint: name: Lint babel-plugin-react-forget runs-on: ubuntu-latest @@ -25,7 +27,7 @@ jobs: node-version: 18.x cache: "yarn" cache-dependency-path: forget/yarn.lock - - name: cache node_modules + - name: Restore cached node_modules uses: actions/cache@v3 with: path: "**/node_modules" @@ -37,6 +39,28 @@ jobs: - run: yarn workspace babel-plugin-react-forget lint working-directory: forget + # Hardcoded to improve parallelism for babel-plugin-react-forget + jest: + name: Jest babel-plugin-react-forget + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + cache: "yarn" + cache-dependency-path: forget/yarn.lock + - name: Restore cached node_modules + uses: actions/cache@v3 + id: node_modules + with: + path: "**/node_modules" + key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + - run: yarn install --frozen-lockfile + working-directory: forget + - run: yarn workspace babel-plugin-react-forget jest + working-directory: forget + test: name: Test ${{ matrix.workspace_name }} needs: discover_yarn_workspaces @@ -52,8 +76,9 @@ jobs: node-version: 18.x cache: "yarn" cache-dependency-path: forget/yarn.lock - - name: cache node_modules + - name: Restore cached node_modules uses: actions/cache@v3 + id: node_modules with: path: "**/node_modules" key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} diff --git a/compiler/forget/packages/babel-plugin-react-forget/package.json b/compiler/forget/packages/babel-plugin-react-forget/package.json index ad09ad1352..90be075fb1 100644 --- a/compiler/forget/packages/babel-plugin-react-forget/package.json +++ b/compiler/forget/packages/babel-plugin-react-forget/package.json @@ -9,7 +9,7 @@ ], "scripts": { "build": "rimraf dist && tsc", - "test": "concurrently -g -n jest,snap,sprout \"yarn jest\" \"yarn snap:ci\" \"yarn sprout:ci\"", + "test": "concurrently -g -n snap,sprout \"yarn snap:ci\" \"yarn sprout:ci\"", "jest": "tsc && ts-node \"$(yarn --silent which jest)\"", "snap": "node ../snap/dist/main.js", "snap:build": "yarn workspace snap run build",