From 884056fc9d282632e6a25e64f2b7e48eab25f987 Mon Sep 17 00:00:00 2001 From: Ismail Syed Date: Wed, 9 Dec 2020 18:12:01 -0500 Subject: [PATCH] Parallel CI jobs --- .github/workflows/node-ci.yml | 112 +++++++++++++++++++++++++++++++--- 1 file changed, 102 insertions(+), 10 deletions(-) diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml index a08e4a570f..e425288098 100644 --- a/.github/workflows/node-ci.yml +++ b/.github/workflows/node-ci.yml @@ -1,15 +1,10 @@ name: Node-CI -on: - push: - branches: [master] - pull_request: - branches: [master] +on: push jobs: - node-tests: + node-lint: runs-on: ubuntu-latest - strategy: matrix: node-version: [10.x, 12.x, 14.x] @@ -39,16 +34,113 @@ jobs: - name: 📦 Install dependencies run: yarn --production=false --frozen-lockfile - - name: 🔨 Build - run: yarn build --verbose - - name: 💅🏼 Lint run: | yarn lint yarn ci:lint-docs + node-build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + name: Checkout + + - uses: actions/setup-node@v1 + name: Use Node.js ${{ matrix.node-version }} + with: + node-version: ${{ matrix.node-version }} + + - name: Get yarn cache directory + id: yarn-cache-get-dir + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + name: Restore yarn cache + with: + path: ${{ steps.yarn-cache-get-dir.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: 📦 Install dependencies + run: yarn --production=false --frozen-lockfile + + - name: 🔨 Build + run: yarn build --verbose + + node-e2e-tests: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + name: Checkout + + - uses: actions/setup-node@v1 + name: Use Node.js ${{ matrix.node-version }} + with: + node-version: ${{ matrix.node-version }} + + - name: Get yarn cache directory + id: yarn-cache-get-dir + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + name: Restore yarn cache + with: + path: ${{ steps.yarn-cache-get-dir.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: 📦 Install dependencies + run: yarn --production=false --frozen-lockfile + + - name: 🔨 Build + run: yarn build --verbose + - name: E2E tests run: yarn test:ci --testPathPattern react-server address + node-unit-tests: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + name: Checkout + + - uses: actions/setup-node@v1 + name: Use Node.js ${{ matrix.node-version }} + with: + node-version: ${{ matrix.node-version }} + + - name: Get yarn cache directory + id: yarn-cache-get-dir + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v2 + id: yarn-cache + name: Restore yarn cache + with: + path: ${{ steps.yarn-cache-get-dir.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: 📦 Install dependencies + run: yarn --production=false --frozen-lockfile + - name: Unit tests run: yarn test:ci --testPathIgnorePatterns react-server address