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.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
ci: speedup Windows CI (#9426)
Brooooooklyn8463e4d683fb
diff --git a/.github/actions/build-rust/action.yml b/.github/actions/build-rust/action.ymlindex 22300abdf7..004fe52fbc 100644--- a/.github/actions/build-rust/action.yml+++ b/.github/actions/build-rust/action.yml@@ -7,6 +7,10 @@ inputs:package:description: 'Package to build'required: true+ no-build:+ description: 'Whether to skip building'+ required: false+ default: 'false'runs:using: 'composite'@@ -14,20 +18,34 @@ runs:- name: Print rustup toolchain versionshell: bashid: rustup-version+ working-directory: ${{ env.DEV_DRIVE_WORKSPACE || github.workspace }}run: |export RUST_TOOLCHAIN_VERSION="$(grep 'channel' rust-toolchain.toml | head -1 | awk -F '"' '{print $2}')"echo "Rust toolchain version: $RUST_TOOLCHAIN_VERSION"echo "RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION" >> "$GITHUB_OUTPUT"- name: Setup Rustuses: dtolnay/rust-toolchain@stable+ if: ${{ runner.os != 'Windows' }}with:toolchain: '${{ steps.rustup-version.outputs.RUST_TOOLCHAIN_VERSION }}'targets: ${{ inputs.target }}env:CARGO_INCREMENTAL: '1'+ - name: Setup Rust+ uses: dtolnay/rust-toolchain@stable+ if: ${{ runner.os == 'Windows' }}+ with:+ toolchain: '${{ steps.rustup-version.outputs.RUST_TOOLCHAIN_VERSION }}'+ targets: ${{ inputs.target }}+ env:+ CARGO_INCREMENTAL: '1'+ CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo+ RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup+- name: Set CC- if: ${{ contains(inputs.target, 'linux') && inputs.package != '@affine/native' }}+ if: ${{ contains(inputs.target, 'linux') && inputs.package != '@affine/native' && inputs.no-build != 'true' }}+ working-directory: ${{ env.DEV_DRIVE_WORKSPACE || github.workspace }}shell: bashrun: |echo "CC=clang" >> "$GITHUB_ENV"@@ -35,12 +53,37 @@ runs:- name: Cache cargouses: Swatinem/rust-cache@v2+ if: ${{ runner.os == 'Windows' }}+ with:+ workspaces: ${{ inputs.workspace-path }}+ save-if: ${{ github.ref_name == 'canary' }}+ shared-key: ${{ inputs.target }}-${{ inputs.package }}+ env:+ CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo+ RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup++ - name: Cache cargo+ uses: Swatinem/rust-cache@v2+ if: ${{ runner.os != 'Windows' }}with:save-if: ${{ github.ref_name == 'canary' }}- shared-key: ${{ inputs.target }}-inputs.package+ shared-key: ${{ inputs.target }}-${{ inputs.package }}++ - name: Build+ shell: bash+ if: ${{ runner.os != 'Windows' && inputs.no-build != 'true' }}+ run: |+ yarn workspace ${{ inputs.package }} build --target ${{ inputs.target }} --use-napi-cross+ env:+ DEBUG: 'napi:*'+- name: Build+ working-directory: ${{ env.DEV_DRIVE_WORKSPACE || github.workspace }}shell: bash+ if: ${{ runner.os == 'Windows' && inputs.no-build != 'true' }}run: |yarn workspace ${{ inputs.package }} build --target ${{ inputs.target }} --use-napi-crossenv:DEBUG: 'napi:*'+ CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo+ RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustupdiff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.ymlindex 5ed9ccd261..1a1d422f2c 100644--- a/.github/actions/setup-node/action.yml+++ b/.github/actions/setup-node/action.yml@@ -35,10 +35,19 @@ inputs:full-cache:description: 'Full installation cache'required: false-runs:using: 'composite'steps:+ - name: Output workspace path+ id: workspace-path+ shell: bash+ run: |+ if [ -n "${{ env.DEV_DRIVE_WORKSPACE }}" ]; then+ echo "workspace_path=${{ env.DEV_DRIVE_WORKSPACE }}" >> $GITHUB_OUTPUT+ else+ echo "workspace_path=${{ github.workspace }}" >> $GITHUB_OUTPUT+ fi+- name: Setup Node.jsuses: actions/setup-node@v4with:@@ -52,26 +61,31 @@ runs:- name: Init CorePackif: ${{ inputs.corepack-install == 'true' }}shell: bash+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}run: corepack enable- name: Set nmModeif: ${{ inputs.hard-link-nm == 'false' }}shell: bash+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}run: yarn config set nmMode classic- name: Set nmHoistingLimitsif: ${{ inputs.nmHoistingLimits }}shell: bash+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}run: yarn config set nmHoistingLimits ${{ inputs.nmHoistingLimits }}- name: Set enableScriptsif: ${{ inputs.enableScripts == 'false' }}shell: bash+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}run: yarn config set enableScripts false- name: Set yarn global cache pathshell: bashid: yarn-cache+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}run: node -e "const p = $(yarn config cacheFolder --json).effective; console.log('yarn_global_cache=' + p)" >> $GITHUB_OUTPUT- name: Cache non-full yarn cache on Linux@@ -79,7 +93,7 @@ runs:if: ${{ inputs.full-cache != 'true' && runner.os == 'Linux' }}with:path: |- node_modules+ ${{ steps.workspace-path.outputs.workspace_path }}/node_modules${{ steps.yarn-cache.outputs.yarn_global_cache }}key: node_modules-cache-${{ github.job }}-${{ runner.os }}-${{ runner.arch }}-${{ steps.system-info.outputs.name }}-${{ steps.system-info.outputs.release }}-${{ steps.system-info.outputs.version }}@@ -115,17 +129,7 @@ runs:if: ${{ inputs.package-install == 'true' }}continue-on-error: trueshell: bash- run: yarn ${{ inputs.extra-flags }}- env:- HUSKY: '0'- PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'- ELECTRON_SKIP_BINARY_DOWNLOAD: '1'- SENTRYCLI_SKIP_DOWNLOAD: '1'- DEBUG: '*'-- - name: yarn install (try again)- if: ${{ steps.install.outcome == 'failure' }}- shell: bash+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}run: yarn ${{ inputs.extra-flags }}env:HUSKY: '0'@@ -138,6 +142,7 @@ runs:id: playwright-versionif: ${{ inputs.playwright-install == 'true' }}shell: bash+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}run: echo "version=$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://' | head -n 1)" >> $GITHUB_OUTPUT# Attempt to restore the correct Playwright browser binaries based on the@@ -150,7 +155,7 @@ runs:id: playwright-cacheif: ${{ inputs.playwright-install == 'true' }}with:- path: ${{ github.workspace }}/node_modules/.cache/ms-playwright+ path: ${{ steps.workspace-path.outputs.workspace_path }}/node_modules/.cache/ms-playwrightkey: '${{ runner.os }}-${{ runner.arch }}-${{ steps.system-info.outputs.name }}-${{ steps.system-info.outputs.release }}-${{ steps.system-info.outputs.version }}-playwright-${{ steps.playwright-version.outputs.version }}'# As a fallback, if the Playwright version has changed, try use the# most recently cached version. There's a good chance that at least one@@ -169,12 +174,14 @@ runs:shell: bashif: inputs.playwright-install == 'true'run: yarn playwright install --with-deps chromium webkit+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}env:- PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/node_modules/.cache/ms-playwright+ PLAYWRIGHT_BROWSERS_PATH: ${{ steps.workspace-path.outputs.workspace_path }}/node_modules/.cache/ms-playwright- name: Get installed Electron versionid: electron-versionif: ${{ inputs.electron-install == 'true' }}+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}shell: bashrun: |echo "version=$(yarn why --json electron | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://' | head -n 1)" >> $GITHUB_OUTPUT@@ -183,7 +190,7 @@ runs:id: electron-cacheif: ${{ inputs.electron-install == 'true' }}with:- path: 'node_modules/.cache/electron'+ path: ${{ steps.workspace-path.outputs.workspace_path }}/node_modules/.cache/electronkey: '${{ runner.os }}-${{ runner.arch }}-${{ steps.system-info.outputs.name }}-${{ steps.system-info.outputs.release }}-${{ steps.system-info.outputs.version }}-electron-${{ steps.electron-version.outputs.version }}'restore-keys: |${{ runner.os }}-${{ runner.arch }}-${{ steps.system-info.outputs.name }}-${{ steps.system-info.outputs.release }}-${{ steps.system-info.outputs.version }}-electron-@@ -192,5 +199,11 @@ runs:shell: bashif: inputs.electron-install == 'true'run: node ./node_modules/electron/install.js+ working-directory: ${{ steps.workspace-path.outputs.workspace_path }}env:- electron_config_cache: ./node_modules/.cache/electron+ electron_config_cache: ${{ steps.workspace-path.outputs.workspace_path }}/node_modules/.cache/electron++ - name: Write PLAYWRIGHT_BROWSERS_PATH env+ shell: bash+ run: |+ echo "PLAYWRIGHT_BROWSERS_PATH=${{ steps.workspace-path.outputs.workspace_path }}/node_modules/.cache/ms-playwright" >> $GITHUB_ENVdiff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.ymldeleted file mode 100644index a555df3f3e..0000000000--- a/.github/actions/setup-rust/action.yml+++ /dev/null@@ -1,28 +0,0 @@-name: 'Rust setup'-description: 'Rust setup, including cache configuration'-inputs:- components:- description: 'Cargo components'- required: false- targets:- description: 'Cargo target'- required: false- toolchain:- description: 'Rustup toolchain'- required: false- default: 'stable'--runs:- using: 'composite'- steps:- - name: Setup Rust- uses: dtolnay/rust-toolchain@stable- with:- toolchain: ${{ inputs.toolchain }}- targets: ${{ inputs.targets }}- components: ${{ inputs.components }}- - name: Add Targets- if: ${{ inputs.targets }}- run: rustup target add ${{ inputs.targets }}- shell: bash- - uses: Swatinem/rust-cache@v2diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.ymlindex 965c35364f..0dae039b82 100644--- a/.github/workflows/build-test.yml+++ b/.github/workflows/build-test.yml@@ -19,7 +19,6 @@ env:AFFINE_ENV: devCOVERAGE: trueMACOSX_DEPLOYMENT_TARGET: '10.13'- PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/node_modules/.cache/ms-playwrightDEPLOYMENT_TYPE: affineconcurrency:@@ -280,11 +279,16 @@ jobs:spec:- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu }- { os: windows-latest, target: x86_64-pc-windows-msvc }- - { os: macos-14, target: x86_64-apple-darwin }- - { os: macos-14, target: aarch64-apple-darwin }+ - { os: macos-latest, target: x86_64-apple-darwin }+ - { os: macos-latest, target: aarch64-apple-darwin }steps:- uses: actions/checkout@v4+ - uses: samypr100/setup-dev-drive@v3+ if: ${{ matrix.spec.os == 'windows-latest' }}+ with:+ workspace-copy: true+ drive-size: 8GB- name: Setup Node.jsuses: ./.github/actions/setup-nodewith:@@ -292,6 +296,7 @@ jobs:electron-install: false- name: Setup filenameid: filename+ working-directory: ${{ env.DEV_DRIVE_WORKSPACE || github.workspace }}shell: bashrun: |export PLATFORM_ARCH_ABI=$(node -e "console.log(require('@napi-rs/cli').parseTriple('${{ matrix.spec.target }}').platformArchABI)")@@ -305,7 +310,7 @@ jobs:uses: actions/upload-artifact@v4with:name: ${{ steps.filename.outputs.filename }}- path: ./packages/frontend/native/${{ steps.filename.outputs.filename }}+ path: ${{ env.DEV_DRIVE_WORKSPACE || github.workspace }}/packages/frontend/native/${{ steps.filename.outputs.filename }}if-no-files-found: errorbuild-server-native:@@ -435,7 +440,10 @@ jobs:steps:- uses: actions/checkout@v4- name: Setup Rust- uses: ./.github/actions/setup-rust+ uses: ./.github/actions/build-rust+ with:+ package: 'affine'+ no-build: 'true'- name: Install latest nextest releaseuses: taiki-e/install-action@nextest@@ -717,14 +725,14 @@ jobs:matrix:spec:- {- os: macos-14,+ os: macos-latest,platform: macos,arch: x64,target: x86_64-apple-darwin,test: false,}- {- os: macos-14,+ os: macos-latest,platform: macos,arch: arm64,target: aarch64-apple-darwin,diff --git a/.github/workflows/copilot-test.yml b/.github/workflows/copilot-test.ymlindex e330ca49f6..e91942173b 100644--- a/.github/workflows/copilot-test.yml+++ b/.github/workflows/copilot-test.yml@@ -3,9 +3,6 @@ name: Copilot Cron Teston:workflow_dispatch:-env:- PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/node_modules/.cache/ms-playwright-jobs:build-server-native:name: Build Server nativediff --git a/.github/workflows/release-mobile.yml b/.github/workflows/release-mobile.ymlindex fa9249f4aa..d9cb0a549f 100644--- a/.github/workflows/release-mobile.yml+++ b/.github/workflows/release-mobile.yml@@ -149,9 +149,11 @@ jobs:p12-file-base64: ${{ secrets.CERTIFICATES_P12_MOBILE }}p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD_MOBILE }}- name: Setup Rust- uses: ./.github/actions/setup-rust+ uses: ./.github/actions/build-rustwith:- targets: 'aarch64-apple-ios'+ target: 'aarch64-apple-ios'+ package: 'affine_mobile_native'+ no-build: 'true'- name: Build Rustrun: |brew install swiftformat@@ -195,9 +197,11 @@ jobs:hard-link-nm: falseenableScripts: false- name: Setup Rust- uses: ./.github/actions/setup-rust+ uses: ./.github/actions/build-rustwith:- targets: 'aarch64-linux-android'+ target: 'aarch64-linux-android'+ package: 'affine_mobile_native'+ no-build: 'true'- name: Cap syncrun: yarn workspace @affine/android cap sync- uses: actions/setup-python@v5