Skip to content

Commit

Permalink
ci: reuse artifacts from previous pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Dec 17, 2024
1 parent 36ac793 commit 654ffc3
Show file tree
Hide file tree
Showing 19 changed files with 136 additions and 137 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -555,12 +555,16 @@ jobs:
matrix:
tests:
- name: 'Server E2E Test 1/3'
artifact: test-results-e2e-server-1
script: yarn workspace @affine-test/affine-cloud e2e --forbid-only --shard=1/3
- name: 'Server E2E Test 2/3'
artifact: test-results-e2e-server-2
script: yarn workspace @affine-test/affine-cloud e2e --forbid-only --shard=2/3
- name: 'Server E2E Test 3/3'
artifact: test-results-e2e-server-3
script: yarn workspace @affine-test/affine-cloud e2e --forbid-only --shard=3/3
- name: 'Server Desktop E2E Test'
artifact: test-results-e2e-server-desktop
script: |
yarn workspace @affine/electron build:dev
# Workaround for Electron apps failing to initialize on Ubuntu 24.04 due to AppArmor restrictions
Expand Down Expand Up @@ -601,6 +605,11 @@ jobs:
playwright-install: true
hard-link-nm: false

- name: Download web artifact
uses: ./.github/actions/download-web
with:
path: packages/frontend/apps/electron/renderer/dist

- name: Download server-native.node
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -628,7 +637,7 @@ jobs:
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: test-results-e2e-server
name: test-results-e2e-server-${{ matrix.tests.artifact }}
path: ./test-results
if-no-files-found: ignore

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
"dev:electron": "yarn workspace @affine/electron dev",
"build:electron": "yarn nx build @affine/electron",
"build:server-native": "yarn nx run-many -t build -p @affine/server-native",
"start:web-static": "yarn workspace @affine/web static-server",
"serve:test-static": "yarn exec serve tests/fixtures --cors -p 8081",
"lint:eslint": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" eslint --report-unused-disable-directives-severity=off . --cache",
"lint:eslint:fix": "yarn lint:eslint --fix",
"lint:prettier": "prettier --ignore-unknown --cache --check .",
Expand Down
3 changes: 1 addition & 2 deletions packages/frontend/apps/android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"browser": "src/index.tsx",
"scripts": {
"build": "cross-env DISTRIBUTION=android yarn workspace @affine/cli bundle",
"dev": "yarn workspace @affine/cli dev",
"static-server": "cross-env DISTRIBUTION=android yarn workspace @affine/cli dev --static"
"dev": "yarn workspace @affine/cli dev"
},
"dependencies": {
"@affine/component": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/apps/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@electron-forge/plugin-auto-unpack-natives": "^7.6.0",
"@electron-forge/shared-types": "^7.6.0",
"@emotion/react": "^11.14.0",
"@oxc-node/core": "^0.0.16",
"@pengx17/electron-forge-maker-appimage": "^1.2.1",
"@sentry/electron": "^5.8.0",
"@sentry/esbuild-plugin": "^2.22.7",
Expand Down
3 changes: 1 addition & 2 deletions packages/frontend/apps/ios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"build": "cross-env DISTRIBUTION=ios yarn workspace @affine/cli bundle",
"dev": "yarn workspace @affine/cli dev",
"sync": "yarn cap sync",
"sync:dev": "CAP_SERVER_URL=http://localhost:8080 yarn cap sync",
"static-server": "cross-env DISTRIBUTION=ios yarn workspace @affine/cli dev --static"
"sync:dev": "CAP_SERVER_URL=http://localhost:8080 yarn cap sync"
},
"dependencies": {
"@affine/component": "workspace:*",
Expand Down
3 changes: 1 addition & 2 deletions packages/frontend/apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"browser": "src/index.tsx",
"scripts": {
"build": "cross-env DISTRIBUTION=mobile yarn workspace @affine/cli bundle",
"dev": "yarn workspace @affine/cli dev",
"static-server": "cross-env DISTRIBUTION=mobile yarn workspace @affine/cli dev --static"
"dev": "yarn workspace @affine/cli dev"
},
"dependencies": {
"@affine/component": "workspace:*",
Expand Down
3 changes: 1 addition & 2 deletions packages/frontend/apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"browser": "src/index.tsx",
"scripts": {
"build": "cross-env DISTRIBUTION=web yarn workspace @affine/cli bundle",
"dev": "yarn workspace @affine/cli dev",
"static-server": "yarn workspace @affine/cli dev --static"
"dev": "yarn workspace @affine/cli dev"
},
"dependencies": {
"@affine/component": "workspace:*",
Expand Down
15 changes: 4 additions & 11 deletions tests/affine-cloud-copilot/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,17 @@ const config: PlaywrightTestConfig = {
retries: 3,
reporter: process.env.CI ? 'github' : 'list',
webServer: [
{
command: 'yarn run serve:test-static',
port: 8081,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE || 'false',
ENABLE_DEBUG_PAGE: '1',
},
},
// Intentionally not building the web, reminds you to run it by yourself.
{
command: 'yarn -T run start:web-static',
command: 'yarn -T run dev',
port: 8080,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE || 'false',
DISTRIBUTION: 'web',
BUILD_TYPE: 'canary',
...process.env,
},
},
{
Expand Down
15 changes: 4 additions & 11 deletions tests/affine-cloud/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,17 @@ const config: PlaywrightTestConfig = {
retries: process.env.COPILOT ? 1 : 3,
reporter: process.env.CI ? 'github' : 'list',
webServer: [
{
command: 'yarn run serve:test-static',
port: 8081,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE || 'false',
ENABLE_DEBUG_PAGE: '1',
},
},
// Intentionally not building the web, reminds you to run it by yourself.
{
command: 'yarn -T run start:web-static',
command: 'yarn -T run dev',
port: 8080,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE || 'false',
DISTRIBUTION: 'web',
BUILD_TYPE: 'canary',
...process.env,
},
},
{
Expand Down
5 changes: 3 additions & 2 deletions tests/affine-desktop-cloud/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { testResultDir } from '@affine-test/kit/playwright';
import type { PlaywrightTestConfig } from '@playwright/test';
// import { devices } from '@playwright/test';

/**
* Read environment variables from file.
Expand All @@ -23,14 +22,16 @@ const config: PlaywrightTestConfig = {
webServer: [
// Intentionally not building the web, reminds you to run it by yourself.
{
command: 'yarn -T run start:web-static',
command: 'yarn -T run dev',
port: 8080,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
stdout: 'pipe',
env: {
COVERAGE: process.env.COVERAGE || 'false',
DISTRIBUTION: 'desktop',
BUILD_TYPE: 'canary',
...process.env,
},
},
{
Expand Down
6 changes: 4 additions & 2 deletions tests/affine-desktop/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import assert from 'node:assert';

import { testResultDir } from '@affine-test/kit/playwright';
import type { PlaywrightTestConfig } from '@playwright/test';
// import { devices } from '@playwright/test';

/**
* Read environment variables from file.
Expand Down Expand Up @@ -41,12 +40,15 @@ if (process.env.DEV_SERVER_URL) {
);
config.webServer = [
{
command: 'yarn run start:web-static',
command: 'yarn -T run dev --static',
port: 8080,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE || 'false',
DISTRIBUTION: 'desktop',
BUILD_TYPE: 'canary',
...process.env,
},
},
];
Expand Down
17 changes: 5 additions & 12 deletions tests/affine-local/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type {
PlaywrightTestConfig,
PlaywrightWorkerOptions,
} from '@playwright/test';
// import { devices } from '@playwright/test';

/**
* Read environment variables from file.
Expand Down Expand Up @@ -44,24 +43,18 @@ const config: PlaywrightTestConfig = {
reporter: process.env.CI ? 'github' : 'list',

webServer: [
{
command: 'yarn run serve:test-static',
port: 8081,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE || 'false',
ENABLE_DEBUG_PAGE: '1',
},
},
// Intentionally not building the web, reminds you to run it by yourself.
{
command: 'yarn run start:web-static',
command: 'yarn -T run dev',
port: 8080,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
...process.env,
COVERAGE: process.env.COVERAGE || 'false',
DISTRIBUTION: 'web',
BUILD_TYPE: 'canary',
CI: '1',
},
},
],
Expand Down
16 changes: 5 additions & 11 deletions tests/affine-mobile/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,18 @@ const config: PlaywrightTestConfig = {
reporter: process.env.CI ? 'github' : 'list',

webServer: [
{
command: 'yarn run serve:test-static',
port: 8081,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE || 'false',
ENABLE_DEBUG_PAGE: '1',
},
},
// Intentionally not building the web, reminds you to run it by yourself.
{
command: 'yarn workspace @affine/mobile static-server',
command: 'yarn -T run dev',
port: 8080,
timeout: 120 * 1000,
reuseExistingServer: !process.env.CI,
env: {
COVERAGE: process.env.COVERAGE || 'false',
DISTRIBUTION: 'mobile',
BUILD_TYPE: 'canary',
CI: '1',
...process.env,
},
},
],
Expand Down
8 changes: 4 additions & 4 deletions tools/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@clack/prompts": "^0.8.2",
"@magic-works/i18n-codegen": "^0.6.1",
"@napi-rs/simple-git": "^0.1.19",
"@oxc-node/core": "^0.0.16",
"@perfsee/webpack": "^1.13.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
"@sentry/webpack-plugin": "^2.22.7",
Expand All @@ -33,16 +34,15 @@
"style-loader": "^4.0.0",
"swc-loader": "^0.2.6",
"tailwindcss": "^3.4.16",
"terser-webpack-plugin": "^5.3.10",
"ts-node": "^10.9.2",
"terser-webpack-plugin": "^5.3.11",
"vite": "^6.0.3",
"webpack": "^5.97.1",
"webpack-dev-server": "^5.2.0",
"webpack-merge": "^6.0.1"
},
"scripts": {
"bundle": "node --loader ts-node/esm/transpile-only.mjs ./src/bin/build.ts",
"dev": "node --loader ts-node/esm/transpile-only.mjs ./src/bin/dev.ts"
"bundle": "node --import @oxc-node/core/register ./src/bin/build.ts",
"dev": "node --import @oxc-node/core/register ./src/bin/dev.ts"
},
"version": "0.18.0"
}
Loading

0 comments on commit 654ffc3

Please sign in to comment.