diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 5bb0d915d..000000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,168 +0,0 @@ -# Copyright 2020 Signal Messenger, LLC -# SPDX-License-Identifier: AGPL-3.0-only - -name: Benchmark -on: - push: - branches: - - development - - main - - '[0-9]+.[0-9]+.x' - pull_request: - schedule: - - cron: '0 */12 * * *' - -jobs: - linux: - name: Benchmark - strategy: - matrix: - metric: - - startup - - send - - groupSend - - largeGroupSendWithBlocks - - largeGroupSend - - convoOpen - - callHistorySearch - - backup - include: - - metric: startup - script: ts/test-mock/benchmarks/startup_bench.node.js - runCount: 10 - - metric: send - script: ts/test-mock/benchmarks/send_bench.node.js - runCount: 100 - - metric: groupSend - script: ts/test-mock/benchmarks/group_send_bench.node.js - runCount: 100 - conversationSize: 500 - - metric: largeGroupSendWithBlocks - script: ts/test-mock/benchmarks/group_send_bench.node.js - runCount: 50 - conversationSize: 500 - groupSize: 500 - contactCount: 500 - blockedCount: 10 - discardCount: 2 - - metric: largeGroupSend - script: ts/test-mock/benchmarks/group_send_bench.node.js - runCount: 20 - conversationSize: 50 - groupSize: 500 - contactCount: 500 - discardCount: 2 - - metric: convoOpen - script: ts/test-mock/benchmarks/convo_open_bench.node.js - runCount: 100 - - metric: callHistorySearch - script: ts/test-mock/benchmarks/call_history_search_bench.node.js - runCount: 100 - - metric: backup - script: ts/test-mock/benchmarks/backup_bench.node.js - - runs-on: ubuntu-22.04-8-cores - if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' && (!github.event.schedule || github.ref == 'refs/heads/main') }} - timeout-minutes: 30 - - steps: - - name: Get system specs - run: lsb_release -a - - name: Get other system specs - run: uname -a - - - name: Clone Desktop repo - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - # - name: Setup sccache - # uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7 - # - name: Restore sccache - # uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 - # id: cache-sccache - # with: - # path: ${{ env.SCCACHE_PATH }} - # key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }} - - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - - name: Setup node.js - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 - with: - node-version-file: '.nvmrc' - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - - name: Cache .electron-gyp - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 - with: - path: ~/.electron-gyp - key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} - - name: Install xvfb and libpulse0 - run: sudo apt-get install xvfb libpulse0 || (sudo apt-get update && sudo apt-get install xvfb libpulse0) - - - name: Install Desktop node_modules - run: pnpm install - env: - # CC: sccache gcc - # CXX: sccache g++ - # SCCACHE_GHA_ENABLED: "true" - NPM_CONFIG_LOGLEVEL: verbose - # We rebuild in `electron:install-app-deps` that doesn't look at this - # environment variable - NPM_CONFIG_NODE_GYP: echo - - - name: Build typescript - run: pnpm run generate - - name: Create preload cache - run: xvfb-run --auto-servernum pnpm run build:preload-cache - - - name: Set MAX_CYCLES=2 on main - if: ${{ github.ref == 'refs/heads/main' }} - run: | - echo "MAX_CYCLES=2" >> "$GITHUB_ENV" - - - name: Run ${{ matrix.metric }} - run: | - set -o pipefail - xvfb-run --auto-servernum ./node_modules/.bin/tsx \ - ${{ matrix.script }} | tee benchmark.log - timeout-minutes: 10 - env: - NODE_ENV: production - ELECTRON_ENABLE_STACK_DUMPING: on - DEBUG: 'mock:benchmarks' - ARTIFACTS_DIR: artifacts/${{ matrix.metric }} - GROUP_SIZE: ${{ matrix.groupSize }} - CONTACT_COUNT: ${{ matrix.contactCount }} - BLOCKED_COUNT: ${{ matrix.blockedCount }} - DISCARD_COUNT: ${{ matrix.discardCount }} - RUN_COUNT: ${{ matrix.runCount }} - CONVERSATION_SIZE: ${{ matrix.conversationSize }} - - - name: Upload benchmark logs on failure - if: failure() - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 - with: - name: logs - path: artifacts - - - name: Clone benchmark repo - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - repository: 'signalapp/Signal-Desktop-Benchmarks-Private' - path: 'benchmark-results' - token: ${{ secrets.AUTOMATED_GITHUB_PAT }} - - - name: Build benchmark repo - working-directory: benchmark-results - run: | - pnpm install - pnpm run build - - - name: Publish - working-directory: benchmark-results - run: | - node ./bin/publish.js ../benchmark.log desktop.ci.performance.${{ matrix.metric }} - env: - OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }} - OTEL_EXPORTER_OTLP_PROTOCOL: ${{ secrets.OTEL_EXPORTER_OTLP_PROTOCOL }} - OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 970541f38..012210444 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -390,8 +390,8 @@ jobs: name: Mock Tests needs: lint - continue-on-error: true strategy: + fail-fast: false matrix: workerIndex: [0, 1, 2, 3] @@ -495,8 +495,8 @@ jobs: name: Check Min OS Version needs: lint - continue-on-error: true strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -545,3 +545,242 @@ jobs: - name: Run OS version check run: | node scripts/check-min-os-version.mjs + + danger: + name: Danger + runs-on: ubuntu-latest + timeout-minutes: 30 + if: github.event_name == 'pull_request' + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - name: Setup pnpm + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 + - name: Setup node.js + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + node-version-file: '.nvmrc' + package-manager-cache: false # Avoid cache key clashes + - name: Install danger node_modules + run: pnpm install + working-directory: danger + - name: Run DangerJS + run: pnpm run danger:ci + working-directory: danger + env: + DANGER_GITHUB_API_TOKEN: ${{ secrets.AUTOMATED_GITHUB_PAT }} + + storybook: + name: Storybook + runs-on: ubuntu-latest-8-cores + timeout-minutes: 30 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - name: Setup pnpm + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 + - name: Setup node.js + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' + - name: Cache .electron-gyp + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: ~/.electron-gyp + key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} + + # - name: Setup sccache + # uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7 + # - name: Restore sccache + # uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + # id: cache-sccache + # with: + # path: ${{ env.SCCACHE_PATH }} + # key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }} + + - name: Install Desktop node_modules + run: pnpm install + env: + # CC: sccache gcc + # CXX: sccache g++ + # SCCACHE_GHA_ENABLED: "true" + NPM_CONFIG_LOGLEVEL: verbose + # We rebuild in `electron:install-app-deps` that doesn't look at this + # environment variable + NPM_CONFIG_NODE_GYP: echo + + - run: pnpm run build:storybook + - run: ./node_modules/.bin/playwright install chromium + - run: ./node_modules/.bin/run-p --race test:storybook:serve test:storybook:test + + benchmark: + name: Benchmark + strategy: + matrix: + metric: + - startup + - send + - groupSend + - largeGroupSendWithBlocks + - largeGroupSend + - convoOpen + - callHistorySearch + - backup + include: + - metric: startup + script: ts/test-mock/benchmarks/startup_bench.node.js + runCount: 10 + - metric: send + script: ts/test-mock/benchmarks/send_bench.node.js + runCount: 100 + - metric: groupSend + script: ts/test-mock/benchmarks/group_send_bench.node.js + runCount: 100 + conversationSize: 500 + - metric: largeGroupSendWithBlocks + script: ts/test-mock/benchmarks/group_send_bench.node.js + runCount: 50 + conversationSize: 500 + groupSize: 500 + contactCount: 500 + blockedCount: 10 + discardCount: 2 + - metric: largeGroupSend + script: ts/test-mock/benchmarks/group_send_bench.node.js + runCount: 20 + conversationSize: 50 + groupSize: 500 + contactCount: 500 + discardCount: 2 + - metric: convoOpen + script: ts/test-mock/benchmarks/convo_open_bench.node.js + runCount: 100 + - metric: callHistorySearch + script: ts/test-mock/benchmarks/call_history_search_bench.node.js + runCount: 100 + - metric: backup + script: ts/test-mock/benchmarks/backup_bench.node.js + + runs-on: ubuntu-22.04-8-cores + if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }} + timeout-minutes: 30 + + steps: + - name: Get system specs + run: lsb_release -a + - name: Get other system specs + run: uname -a + + - name: Clone Desktop repo + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + # - name: Setup sccache + # uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7 + # - name: Restore sccache + # uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + # id: cache-sccache + # with: + # path: ${{ env.SCCACHE_PATH }} + # key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }} + + - name: Setup pnpm + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 + - name: Setup node.js + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 + with: + node-version-file: '.nvmrc' + cache: 'pnpm' + cache-dependency-path: 'pnpm-lock.yaml' + - name: Cache .electron-gyp + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: ~/.electron-gyp + key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} + - name: Install xvfb and libpulse0 + run: sudo apt-get install xvfb libpulse0 || (sudo apt-get update && sudo apt-get install xvfb libpulse0) + + - name: Install Desktop node_modules + run: pnpm install + env: + # CC: sccache gcc + # CXX: sccache g++ + # SCCACHE_GHA_ENABLED: "true" + NPM_CONFIG_LOGLEVEL: verbose + # We rebuild in `electron:install-app-deps` that doesn't look at this + # environment variable + NPM_CONFIG_NODE_GYP: echo + + - name: Build typescript + run: pnpm run generate + - name: Create preload cache + run: xvfb-run --auto-servernum pnpm run build:preload-cache + + - name: Set MAX_CYCLES=2 on main + if: ${{ github.ref == 'refs/heads/main' }} + run: | + echo "MAX_CYCLES=2" >> "$GITHUB_ENV" + + - name: Run ${{ matrix.metric }} + run: | + set -o pipefail + xvfb-run --auto-servernum ./node_modules/.bin/tsx \ + ${{ matrix.script }} | tee benchmark.log + timeout-minutes: 10 + env: + NODE_ENV: production + ELECTRON_ENABLE_STACK_DUMPING: on + DEBUG: 'mock:benchmarks' + ARTIFACTS_DIR: artifacts/${{ matrix.metric }} + GROUP_SIZE: ${{ matrix.groupSize }} + CONTACT_COUNT: ${{ matrix.contactCount }} + BLOCKED_COUNT: ${{ matrix.blockedCount }} + DISCARD_COUNT: ${{ matrix.discardCount }} + RUN_COUNT: ${{ matrix.runCount }} + CONVERSATION_SIZE: ${{ matrix.conversationSize }} + + - name: Upload benchmark logs on failure + if: failure() + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: logs + path: artifacts + + - name: Clone benchmark repo + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + with: + repository: 'signalapp/Signal-Desktop-Benchmarks-Private' + path: 'benchmark-results' + token: ${{ secrets.AUTOMATED_GITHUB_PAT }} + + - name: Build benchmark repo + working-directory: benchmark-results + run: | + pnpm install + pnpm run build + + - name: Publish + working-directory: benchmark-results + run: | + node ./bin/publish.js ../benchmark.log desktop.ci.performance.${{ matrix.metric }} + env: + OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }} + OTEL_EXPORTER_OTLP_PROTOCOL: ${{ secrets.OTEL_EXPORTER_OTLP_PROTOCOL }} + OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }} + + auto-merge-ready: + if: ${{ github.event_name == 'pull_request' && github.repository == 'signalapp/Signal-Desktop-Private' }} + name: Auto Merge Ready + needs: + - lint + - linux + - windows + - sticker-creator + - mock-tests + - check-min-os-version + - danger + - storybook + - benchmark + runs-on: ubuntu-latest + steps: + - name: Ok + run: echo ok diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml deleted file mode 100644 index fea12ac7a..000000000 --- a/.github/workflows/danger.yml +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2020 Signal Messenger, LLC -# SPDX-License-Identifier: AGPL-3.0-only - -name: Danger -on: - pull_request: - -jobs: - danger: - name: Danger - runs-on: ubuntu-latest - timeout-minutes: 30 - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - - name: Setup node.js - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 - with: - node-version-file: '.nvmrc' - package-manager-cache: false # Avoid cache key clashes - - name: Install danger node_modules - run: pnpm install - working-directory: danger - - name: Run DangerJS - run: pnpm run danger:ci - working-directory: danger - env: - DANGER_GITHUB_API_TOKEN: ${{ secrets.AUTOMATED_GITHUB_PAT }} diff --git a/.github/workflows/stories.yml b/.github/workflows/stories.yml deleted file mode 100644 index 355404123..000000000 --- a/.github/workflows/stories.yml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2023 Signal Messenger, LLC -# SPDX-License-Identifier: AGPL-3.0-only -name: Stories -on: - push: - branches: - - development - - main - - '[0-9]+.[0-9]+.x' - pull_request: -jobs: - test: - name: Storybook - runs-on: ubuntu-latest-8-cores - timeout-minutes: 30 - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - name: Setup pnpm - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4 - - name: Setup node.js - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 - with: - node-version-file: '.nvmrc' - cache: 'pnpm' - cache-dependency-path: 'pnpm-lock.yaml' - - name: Cache .electron-gyp - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 - with: - path: ~/.electron-gyp - key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }} - - # - name: Setup sccache - # uses: mozilla-actions/sccache-action@054db53350805f83040bf3e6e9b8cf5a139aa7c9 # v0.0.7 - # - name: Restore sccache - # uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 - # id: cache-sccache - # with: - # path: ${{ env.SCCACHE_PATH }} - # key: sccache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**') }} - - - name: Install Desktop node_modules - run: pnpm install - env: - # CC: sccache gcc - # CXX: sccache g++ - # SCCACHE_GHA_ENABLED: "true" - NPM_CONFIG_LOGLEVEL: verbose - # We rebuild in `electron:install-app-deps` that doesn't look at this - # environment variable - NPM_CONFIG_NODE_GYP: echo - - - run: pnpm run build:storybook - - run: ./node_modules/.bin/playwright install chromium - - run: ./node_modules/.bin/run-p --race test:storybook:serve test:storybook:test