ci: optimize e2e and refactor workflow (#3530)

* ci: split e2e

* chore: 3 parts

* chore: use matrix

* chore: use playwright container, bump playwright

* chore: remove playwright container

* ci: move all packages into matrix

* ci: reusable action to restore build cache

* chore: revert custom action

* chore: cleanup logs
This commit is contained in:
Elliot DeNolf
2023-10-09 23:43:34 -04:00
committed by GitHub
parent 8bfae6b932
commit 890af8be05
5 changed files with 76 additions and 180 deletions

View File

@@ -108,6 +108,10 @@ jobs:
tests-e2e:
runs-on: ubuntu-latest
needs: core-build
strategy:
fail-fast: false
matrix:
part: [1/4, 2/4, 3/4, 4/4]
steps:
- name: Use Node.js 18
@@ -128,14 +132,14 @@ jobs:
key: ${{ github.sha }}-${{ github.run_number }}
- name: E2E Tests
run: pnpm test:e2e --bail
run: pnpm test:e2e --part ${{ matrix.part }} --bail
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: test-results/
retention-days: 30
retention-days: 1
tests-type-generation:
runs-on: ubuntu-latest
@@ -165,11 +169,22 @@ jobs:
- name: Generate GraphQL schema file
run: pnpm dev:generate-graphql-schema graphql-schema-gen
# DB Adapters
build-db-mongodb:
build-packages:
name: Build Packages
runs-on: ubuntu-latest
needs: core-build
strategy:
fail-fast: false
matrix:
pkg:
- db-mongodb
- db-postgres
- bundler-webpack
- bundler-vite
- richtext-slate
- richtext-lexical
- live-preview
- live-preview-react
steps:
- name: Use Node.js 18
@@ -189,162 +204,5 @@ jobs:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build db-mongodb
run: pnpm turbo run build --filter=db-mongodb
build-db-postgres:
runs-on: ubuntu-latest
needs: core-build
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build db-postgres
run: pnpm turbo run build --filter=db-postgres
# Bundlers
build-bundler-webpack:
runs-on: ubuntu-latest
needs: core-build
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build bundler-webpack
run: pnpm turbo run build --filter=bundler-webpack
build-bundler-vite:
runs-on: ubuntu-latest
needs: core-build
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build bundler-vite
run: pnpm turbo run build --filter=bundler-vite
# Other Plugins
build-plugin-richtext-slate:
runs-on: ubuntu-latest
needs: core-build
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build richtext-slate
run: pnpm turbo run build --filter=richtext-slate
build-plugin-richtext-lexical:
runs-on: ubuntu-latest
needs: core-build
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build richtext-lexical
run: pnpm turbo run build --filter=richtext-lexical
build-plugin-live-preview:
runs-on: ubuntu-latest
needs: core-build
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build live-preview
run: pnpm turbo run build --filter=live-preview
- name: Build live-preview-react
run: pnpm turbo run build --filter=live-preview-react
- name: Build ${{ matrix.pkg }}
run: pnpm turbo run build --filter=${{ matrix.pkg }}