Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

ci: improve build-master.yml

himself65d780e90d8895
diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml
index b08bc31749..7080709f77 100644
--- a/.github/workflows/build-master.yml
+++ b/.github/workflows/build-master.yml
@@ -84,9 +84,13 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- test-frontend:
- name: Test Frontend
+ e2e-test:
+ name: E2E Test
runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3, 4]
environment: development
needs: build-frontend
services:
@@ -106,18 +110,14 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- with:
- npm-token: ${{ secrets.NPM_GITHUB_AUTH_TOKEN }}
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: artifact
path: ./apps/web/.next
- - name: Run e2e & unit tests
- run: |
- yarn test --forbid-only
- yarn run test:unit:coverage
+ - name: Run playwright tests
+ run: yarn test --forbid-only --shard=${{ matrix.shard }}/${{ strategy.job-total }}
env:
COVERAGE: true
@@ -133,6 +133,45 @@ jobs:
name: affine
fail_ci_if_error: true
+ - name: Upload test results
+ if: ${{ failure() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: test-results-e2e
+ path: ./test-results
+ if-no-files-found: ignore
+
+ unit-test:
+ name: Unit Test
+ runs-on: ubuntu-latest
+ environment: development
+ needs: build-frontend
+ services:
+ octobase:
+ image: ghcr.io/toeverything/cloud:nightly-latest
+ ports:
+ - 3000:3000
+ env:
+ SIGN_KEY: 'test123'
+ RUST_LOG: 'debug'
+ JWST_DEV: '1'
+ credentials:
+ username: ${{ github.actor }}
+ password: ${{ secrets.ACTIONS_PACKAGE_PUBLISH }}
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup Node.js
+ uses: ./.github/actions/setup-node
+ - name: Download artifact
+ uses: actions/download-artifact@v3
+ with:
+ name: artifact
+ path: ./apps/web/.next
+
+ - name: Unit Test
+ run: yarn run test:unit:coverage
+
- name: Upload unit test coverage results
uses: codecov/codecov-action@v3
with:
@@ -141,11 +180,3 @@ jobs:
flags: unittest
name: affine
fail_ci_if_error: true
-
- - name: Upload test results
- if: ${{ failure() }}
- uses: actions/upload-artifact@v2
- with:
- name: test-results-e2e
- path: ./test-results
- if-no-files-found: ignore