From f72603d967325413bb8ff6080e76bc4b6d02a0b9 Mon Sep 17 00:00:00 2001 From: Pavel Pustovalov Date: Wed, 26 Aug 2020 01:11:21 +0300 Subject: [PATCH] make FE CI more parallel --- .github/workflows/ci-test-frontend.yml | 36 ++++++++++++++++++++++++-- frontend/webpack.config.js | 7 +++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-test-frontend.yml b/.github/workflows/ci-test-frontend.yml index 3e4d3e48..249fa4bb 100644 --- a/.github/workflows/ci-test-frontend.yml +++ b/.github/workflows/ci-test-frontend.yml @@ -13,7 +13,7 @@ on: - 'frontend/**' jobs: - frontend: + frontend-check: runs-on: ubuntu-latest steps: @@ -24,7 +24,39 @@ jobs: - run: npm ci --loglevel warn working-directory: ./frontend - - run: npx run-p check lint + - uses: actions/cache@v2 + with: + path: ${{ github.workspace }}/frontend/node_modules/.cache + key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - run: npx run-p check + working-directory: ./frontend + + frontend-lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + + - run: npm ci --loglevel warn + working-directory: ./frontend + + - run: npx run-p lint + working-directory: ./frontend + + frontend-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + + - run: npm ci --loglevel warn working-directory: ./frontend - run: npm run test diff --git a/frontend/webpack.config.js b/frontend/webpack.config.js index 036267b6..6f4d92f0 100644 --- a/frontend/webpack.config.js +++ b/frontend/webpack.config.js @@ -112,12 +112,15 @@ module.exports = () => ({ }, { test: /\.js(x?)$/, - use: [{ loader: 'babel-loader', options: { configFile: babelConfigPath } }], + use: [{ loader: 'babel-loader', options: { cacheDirectory: true, configFile: babelConfigPath } }], ...getExcluded(), }, { test: /\.ts(x?)$/, - use: [{ loader: 'babel-loader', options: { configFile: babelConfigPath } }, 'ts-loader'], + use: [ + { loader: 'babel-loader', options: { cacheDirectory: true, configFile: babelConfigPath } }, + 'ts-loader', + ], ...getExcluded(), }, {