mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-02 16:57:07 +03:00
78ef9fee34
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [codecov/codecov-action](https://redirect.github.com/codecov/codecov-action) | action | major | `v4` -> `v5` | --- ### Release Notes <details> <summary>codecov/codecov-action (codecov/codecov-action)</summary> ### [`v5`](https://redirect.github.com/codecov/codecov-action/compare/v4...v5) [Compare Source](https://redirect.github.com/codecov/codecov-action/compare/v4...v5) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/AFFiNE). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMS41IiwidXBkYXRlZEluVmVyIjoiMzkuMTEuNSIsInRhcmdldEJyYW5jaCI6ImNhbmFyeSIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->
191 lines
5.9 KiB
YAML
191 lines
5.9 KiB
YAML
name: Copilot Cron Test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
|
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/node_modules/.cache/ms-playwright
|
|
|
|
jobs:
|
|
build-server-native:
|
|
name: Build Server native
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
CARGO_PROFILE_RELEASE_DEBUG: '1'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
extra-flags: workspaces focus @affine/server-native
|
|
electron-install: false
|
|
- name: Build Rust
|
|
uses: ./.github/actions/build-rust
|
|
with:
|
|
target: 'x86_64-unknown-linux-gnu'
|
|
package: '@affine/server-native'
|
|
nx_token: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
|
- name: Upload server-native.node
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: server-native.node
|
|
path: ./packages/backend/native/server-native.node
|
|
if-no-files-found: error
|
|
|
|
copilot-api-test:
|
|
name: Server Copilot Api Test
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- build-server-native
|
|
env:
|
|
NODE_ENV: test
|
|
DISTRIBUTION: web
|
|
DATABASE_URL: postgresql://affine:affine@localhost:5432/affine
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_PASSWORD: affine
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
mailer:
|
|
image: mailhog/mailhog
|
|
ports:
|
|
- 1025:1025
|
|
- 8025:8025
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
playwright-install: true
|
|
electron-install: false
|
|
full-cache: true
|
|
|
|
- name: Download server-native.node
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: server-native.node
|
|
path: ./packages/backend/server
|
|
|
|
- name: Prepare Server Test Environment
|
|
uses: ./.github/actions/server-test-env
|
|
|
|
- name: Run server tests
|
|
run: yarn workspace @affine/server test:copilot:coverage --forbid-only
|
|
env:
|
|
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
|
|
COPILOT_OPENAI_API_KEY: ${{ secrets.COPILOT_OPENAI_API_KEY }}
|
|
COPILOT_FAL_API_KEY: ${{ secrets.COPILOT_FAL_API_KEY }}
|
|
|
|
- name: Upload server test coverage results
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: ./packages/backend/server/.coverage/lcov.info
|
|
flags: server-test
|
|
name: affine
|
|
fail_ci_if_error: false
|
|
|
|
copilot-e2e-test:
|
|
name: Server Copilot E2E Test
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DISTRIBUTION: web
|
|
DATABASE_URL: postgresql://affine:affine@localhost:5432/affine
|
|
IN_CI_TEST: true
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
shardIndex: [1, 2, 3]
|
|
shardTotal: [3]
|
|
needs:
|
|
- build-server-native
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_PASSWORD: affine
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
playwright-install: true
|
|
electron-install: false
|
|
hard-link-nm: false
|
|
|
|
- name: Download server-native.node
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: server-native.node
|
|
path: ./packages/backend/server
|
|
|
|
- name: Run Copilot E2E Test ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
|
|
uses: ./.github/actions/copilot-test
|
|
with:
|
|
script: yarn workspace @affine-test/affine-cloud-copilot e2e --forbid-only --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
|
|
openai-key: ${{ secrets.COPILOT_OPENAI_API_KEY }}
|
|
fal-key: ${{ secrets.COPILOT_FAL_API_KEY }}
|
|
|
|
test-done:
|
|
needs:
|
|
- copilot-api-test
|
|
- copilot-e2e-test
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
name: Post test result message
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
extra-flags: 'workspaces focus @affine/copilot-result'
|
|
electron-install: false
|
|
- name: Post Success event to a Slack channel
|
|
if: ${{ always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
|
|
run: node ./tools/copilot-result/index.js
|
|
env:
|
|
CHANNEL_ID: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }}
|
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
BRANCH_SHA: ${{ github.sha }}
|
|
BRANCH_NAME: ${{ github.ref }}
|
|
COPILOT_RESULT: success
|
|
- name: Post Failed event to a Slack channel
|
|
id: failed-slack
|
|
if: ${{ always() && contains(needs.*.result, 'failure') }}
|
|
run: node ./tools/copilot-result/index.js
|
|
env:
|
|
CHANNEL_ID: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }}
|
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
BRANCH_SHA: ${{ github.sha }}
|
|
BRANCH_NAME: ${{ github.ref }}
|
|
COPILOT_RESULT: failed
|
|
- name: Post Cancel event to a Slack channel
|
|
id: cancel-slack
|
|
if: ${{ always() && contains(needs.*.result, 'cancelled') && !contains(needs.*.result, 'failure') }}
|
|
run: node ./tools/copilot-result/index.js
|
|
env:
|
|
CHANNEL_ID: ${{ secrets.RELEASE_SLACK_CHNNEL_ID }}
|
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
|
BRANCH_SHA: ${{ github.sha }}
|
|
BRANCH_NAME: ${{ github.ref }}
|
|
COPILOT_RESULT: canceled
|