2023-01-03 11:55:46 -08:00
|
|
|
# Copyright 2020 Signal Messenger, LLC
|
2020-10-30 15:34:04 -05:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-03-18 10:50:20 -07:00
|
|
|
name: CI
|
2021-12-23 19:50:07 +01:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- development
|
2022-04-25 15:53:31 -07:00
|
|
|
- main
|
2021-12-23 19:50:07 +01:00
|
|
|
- '[0-9]+.[0-9]+.x'
|
|
|
|
pull_request:
|
2020-03-18 10:50:20 -07:00
|
|
|
|
|
|
|
jobs:
|
2020-03-20 10:33:55 -07:00
|
|
|
lint:
|
2023-10-03 18:38:58 -07:00
|
|
|
runs-on: ubuntu-latest-8-cores
|
2022-02-24 17:21:56 -08:00
|
|
|
timeout-minutes: 30
|
2020-03-20 10:33:55 -07:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- run: lsb_release -a
|
|
|
|
- run: uname -a
|
2022-06-17 13:47:57 +01:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2020-03-20 10:33:55 -07:00
|
|
|
with:
|
2024-02-22 13:19:37 -08:00
|
|
|
node-version: '20.9.0'
|
2024-01-23 16:11:12 -08:00
|
|
|
- run: npm install -g yarn@1.22.10 npm@10.2.5
|
2021-04-13 15:39:46 -07:00
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 13:47:57 +01:00
|
|
|
uses: actions/cache@v3
|
2021-04-13 15:39:46 -07:00
|
|
|
with:
|
|
|
|
path: node_modules
|
2021-11-23 23:00:44 +01:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
2023-03-29 12:53:27 -07:00
|
|
|
|
|
|
|
- name: Restore cached .eslintcache and tsconfig.tsbuildinfo
|
|
|
|
uses: actions/cache/restore@v3
|
|
|
|
id: cache-lint
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
.eslintcache
|
|
|
|
tsconfig.tsbuildinfo
|
|
|
|
key: lint-${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**', '.eslintrc.js', '.eslint/**', 'tsconfig.json') }}
|
|
|
|
|
2021-04-13 15:39:46 -07:00
|
|
|
- name: Install Desktop node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --frozen-lockfile
|
2022-11-16 17:38:25 -08:00
|
|
|
env:
|
|
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
2021-04-13 15:39:46 -07:00
|
|
|
|
2020-03-20 10:33:55 -07:00
|
|
|
- run: yarn generate
|
|
|
|
- run: yarn lint
|
|
|
|
- run: yarn lint-deps
|
2023-01-03 11:55:46 -08:00
|
|
|
- run: yarn lint-license-comments
|
2024-03-01 14:33:18 -06:00
|
|
|
|
|
|
|
- name: Check acknowledgments file is up to date
|
|
|
|
run: yarn build:acknowledgments
|
|
|
|
env:
|
|
|
|
REQUIRE_SIGNAL_LIB_FILES: 1
|
|
|
|
|
2020-12-01 08:42:35 -08:00
|
|
|
- run: git diff --exit-code
|
2020-03-20 10:33:55 -07:00
|
|
|
|
2023-03-29 12:53:27 -07:00
|
|
|
- name: Update cached .eslintcache and tsconfig.tsbuildinfo
|
|
|
|
uses: actions/cache/save@v3
|
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
.eslintcache
|
|
|
|
tsconfig.tsbuildinfo
|
2023-03-29 13:15:05 -07:00
|
|
|
key: ${{ steps.cache-lint.outputs.cache-primary-key }}
|
2023-03-29 12:53:27 -07:00
|
|
|
|
2020-03-18 10:50:20 -07:00
|
|
|
macos:
|
2020-03-20 10:33:55 -07:00
|
|
|
needs: lint
|
2022-09-01 09:35:44 -07:00
|
|
|
runs-on: macos-latest
|
2023-03-28 15:33:32 -07:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2022-02-24 17:21:56 -08:00
|
|
|
timeout-minutes: 30
|
2020-03-18 10:50:20 -07:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- run: uname -a
|
2022-06-17 13:47:57 +01:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2020-03-18 10:50:20 -07:00
|
|
|
with:
|
2024-02-22 13:19:37 -08:00
|
|
|
node-version: '20.9.0'
|
2023-12-06 12:37:47 -05:00
|
|
|
|
2024-01-23 16:11:12 -08:00
|
|
|
- run: npm install -g yarn@1.22.10 npm@10.2.5
|
2021-04-13 15:39:46 -07:00
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 13:47:57 +01:00
|
|
|
uses: actions/cache@v3
|
2021-04-13 15:39:46 -07:00
|
|
|
with:
|
|
|
|
path: node_modules
|
2021-11-23 23:00:44 +01:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
2021-04-13 15:39:46 -07:00
|
|
|
- name: Install Desktop node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --frozen-lockfile
|
2022-11-16 17:38:25 -08:00
|
|
|
env:
|
|
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
2021-04-13 15:39:46 -07:00
|
|
|
|
2020-03-18 10:50:20 -07:00
|
|
|
- run: yarn generate
|
|
|
|
- run: yarn prepare-beta-build
|
2022-09-01 11:15:24 -07:00
|
|
|
- run: yarn test-node
|
|
|
|
- run: yarn test-electron
|
2023-07-20 05:14:08 +02:00
|
|
|
env:
|
|
|
|
ARTIFACTS_DIR: artifacts/macos
|
2022-09-01 11:15:24 -07:00
|
|
|
timeout-minutes: 5
|
2024-01-23 17:31:49 -08:00
|
|
|
- run: touch noop.sh && chmod +x noop.sh
|
2020-03-18 10:50:20 -07:00
|
|
|
- run: yarn build
|
2021-12-17 18:50:42 +01:00
|
|
|
env:
|
|
|
|
DISABLE_INSPECT_FUSE: on
|
2024-01-23 17:31:49 -08:00
|
|
|
SIGN_MACOS_SCRIPT: noop.sh
|
2021-12-03 23:49:15 +01:00
|
|
|
- name: Rebuild native modules for x64
|
|
|
|
run: yarn electron:install-app-deps
|
2021-12-09 09:06:04 +01:00
|
|
|
- run: yarn test-release
|
2020-03-18 10:50:20 -07:00
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
2023-01-05 14:43:33 -08:00
|
|
|
- run: yarn test-eslint
|
2020-03-18 10:50:20 -07:00
|
|
|
|
2023-07-20 05:14:08 +02:00
|
|
|
- name: Upload artifacts on failure
|
|
|
|
if: failure()
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
path: artifacts
|
|
|
|
|
2020-03-18 10:50:20 -07:00
|
|
|
linux:
|
2020-03-20 10:33:55 -07:00
|
|
|
needs: lint
|
2020-03-18 10:50:20 -07:00
|
|
|
runs-on: ubuntu-latest
|
2022-02-24 17:21:56 -08:00
|
|
|
timeout-minutes: 30
|
2020-03-18 10:50:20 -07:00
|
|
|
|
|
|
|
steps:
|
2020-03-20 10:33:55 -07:00
|
|
|
- run: lsb_release -a
|
2020-03-18 10:50:20 -07:00
|
|
|
- run: uname -a
|
2022-06-17 13:47:57 +01:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2020-03-18 10:50:20 -07:00
|
|
|
with:
|
2024-02-22 13:19:37 -08:00
|
|
|
node-version: '20.9.0'
|
2020-03-18 10:50:20 -07:00
|
|
|
- run: sudo apt-get install xvfb
|
2024-01-23 16:11:12 -08:00
|
|
|
|
|
|
|
- run: npm install -g yarn@1.22.10 npm@10.2.5
|
2021-04-13 15:39:46 -07:00
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 13:47:57 +01:00
|
|
|
uses: actions/cache@v3
|
2021-04-13 15:39:46 -07:00
|
|
|
with:
|
|
|
|
path: node_modules
|
2021-11-23 23:00:44 +01:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
2021-04-13 15:39:46 -07:00
|
|
|
- name: Install Desktop node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --frozen-lockfile
|
2022-11-16 17:38:25 -08:00
|
|
|
env:
|
|
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
2021-04-13 15:39:46 -07:00
|
|
|
|
2020-03-18 10:50:20 -07:00
|
|
|
- run: yarn generate
|
|
|
|
- run: yarn prepare-beta-build
|
2023-03-28 15:33:32 -07:00
|
|
|
|
|
|
|
- name: Create bundle
|
|
|
|
run: yarn build:esbuild:prod
|
|
|
|
|
|
|
|
- name: Build with packaging .deb file
|
2023-08-21 19:03:10 -04:00
|
|
|
run: yarn build:release -- --publish=never
|
2023-03-28 15:33:32 -07:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2021-12-17 18:50:42 +01:00
|
|
|
env:
|
|
|
|
DISABLE_INSPECT_FUSE: on
|
2023-03-28 15:33:32 -07:00
|
|
|
- name: Build without packaging .deb file
|
|
|
|
run: yarn build:release --linux dir
|
|
|
|
if: github.ref != 'refs/heads/main'
|
|
|
|
env:
|
|
|
|
DISABLE_INSPECT_FUSE: on
|
|
|
|
|
2020-03-18 10:50:20 -07:00
|
|
|
- run: xvfb-run --auto-servernum yarn test-node
|
|
|
|
- run: xvfb-run --auto-servernum yarn test-electron
|
2022-02-24 17:21:56 -08:00
|
|
|
timeout-minutes: 5
|
2020-03-18 10:50:20 -07:00
|
|
|
env:
|
2023-07-20 05:14:08 +02:00
|
|
|
ARTIFACTS_DIR: artifacts/linux
|
2020-03-18 10:50:20 -07:00
|
|
|
LANG: en_US
|
|
|
|
LANGUAGE: en_US
|
2021-12-09 09:06:04 +01:00
|
|
|
- run: xvfb-run --auto-servernum yarn test-release
|
2020-03-18 10:50:20 -07:00
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
|
|
|
|
2023-07-20 05:14:08 +02:00
|
|
|
- name: Upload artifacts on failure
|
|
|
|
if: failure()
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
path: artifacts
|
|
|
|
|
2020-03-18 10:50:20 -07:00
|
|
|
windows:
|
2020-03-20 10:33:55 -07:00
|
|
|
needs: lint
|
2023-08-01 09:06:29 -07:00
|
|
|
runs-on: windows-2019
|
2022-02-24 17:21:56 -08:00
|
|
|
timeout-minutes: 30
|
2020-03-18 10:50:20 -07:00
|
|
|
|
2023-08-01 09:06:29 -07:00
|
|
|
env:
|
|
|
|
BUILD_LOCATION: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30133\\lib\\x86\\store\\references\\"
|
|
|
|
SDK_LOCATION: "C:\\Program Files (x86)\\Windows Kits\\10\\UnionMetadata\\10.0.17134.0"
|
|
|
|
|
2020-03-18 10:50:20 -07:00
|
|
|
steps:
|
|
|
|
- run: systeminfo
|
|
|
|
- run: git config --global core.autocrlf false
|
|
|
|
- run: git config --global core.eol lf
|
2022-06-17 13:47:57 +01:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2020-03-18 10:50:20 -07:00
|
|
|
with:
|
2024-02-22 13:19:37 -08:00
|
|
|
node-version: '20.9.0'
|
2024-01-23 16:11:12 -08:00
|
|
|
- run: npm install -g yarn@1.22.10 npm@10.2.5 node-gyp@10.0.1
|
2023-10-03 18:38:58 -07:00
|
|
|
|
2023-08-01 09:06:29 -07:00
|
|
|
# Set things up so @nodert-win10-rs4 dependencies build properly
|
|
|
|
- run: dir "$env:BUILD_LOCATION"
|
|
|
|
- run: dir "$env:SDK_LOCATION"
|
|
|
|
- run: "copy \"$env:BUILD_LOCATION\\platform.winmd\" \"$env:SDK_LOCATION\""
|
|
|
|
- run: dir "$env:SDK_LOCATION"
|
2021-04-13 15:39:46 -07:00
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 13:47:57 +01:00
|
|
|
uses: actions/cache@v3
|
2021-04-13 15:39:46 -07:00
|
|
|
with:
|
|
|
|
path: node_modules
|
2021-11-23 23:00:44 +01:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
2021-04-13 15:39:46 -07:00
|
|
|
- name: Install Desktop node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --frozen-lockfile
|
2022-11-16 17:38:25 -08:00
|
|
|
env:
|
2023-10-03 18:38:58 -07:00
|
|
|
CHILD_CONCURRENCY: 1
|
2022-11-16 17:38:25 -08:00
|
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
2021-04-13 15:39:46 -07:00
|
|
|
|
2020-03-18 10:50:20 -07:00
|
|
|
- run: yarn generate
|
|
|
|
- run: yarn test-node
|
|
|
|
- run: copy package.json temp.json
|
|
|
|
- run: del package.json
|
|
|
|
- run: type temp.json | findstr /v certificateSubjectName | findstr /v certificateSha1 > package.json
|
|
|
|
- run: yarn prepare-beta-build
|
2023-03-28 15:33:32 -07:00
|
|
|
|
|
|
|
- name: Create bundle
|
|
|
|
run: yarn build:esbuild:prod
|
|
|
|
|
|
|
|
- name: Build with NSIS
|
|
|
|
run: yarn build:release
|
|
|
|
if: github.ref == 'refs/heads/main'
|
2021-12-17 18:50:42 +01:00
|
|
|
env:
|
|
|
|
DISABLE_INSPECT_FUSE: on
|
2023-03-28 15:33:32 -07:00
|
|
|
- name: Build without NSIS
|
|
|
|
run: yarn build:release --win dir
|
|
|
|
if: github.ref != 'refs/heads/main'
|
|
|
|
env:
|
|
|
|
DISABLE_INSPECT_FUSE: on
|
|
|
|
|
2021-12-09 09:06:04 +01:00
|
|
|
- run: yarn test-electron
|
2023-07-20 05:14:08 +02:00
|
|
|
env:
|
|
|
|
ARTIFACTS_DIR: artifacts/windows
|
2022-02-24 17:21:56 -08:00
|
|
|
timeout-minutes: 5
|
2021-12-09 09:06:04 +01:00
|
|
|
- run: yarn test-release
|
2020-03-18 10:50:20 -07:00
|
|
|
env:
|
|
|
|
SIGNAL_ENV: production
|
2022-01-31 14:01:34 -08:00
|
|
|
|
2023-07-20 05:14:08 +02:00
|
|
|
- name: Upload artifacts on failure
|
|
|
|
if: failure()
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
path: artifacts
|
|
|
|
|
2023-12-13 19:34:49 +01:00
|
|
|
sticker-creator:
|
|
|
|
name: Sticker Creator
|
|
|
|
runs-on: ubuntu-latest-8-cores
|
|
|
|
timeout-minutes: 30
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: sticker-creator
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: '18.17.1'
|
|
|
|
- run: npm install -g yarn@1.22.10
|
|
|
|
|
|
|
|
- name: Install Sticker Creator node_modules
|
|
|
|
run: yarn install
|
|
|
|
|
|
|
|
- name: Build Sticker Creator
|
|
|
|
run: yarn build
|
|
|
|
|
|
|
|
- name: Check Sticker Creator types
|
|
|
|
run: yarn check:types
|
|
|
|
|
|
|
|
- name: Check Sticker Creator formatting
|
|
|
|
run: yarn prettier:check
|
|
|
|
|
|
|
|
- name: Check Sticker Creator linting
|
|
|
|
run: yarn lint
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: yarn test --run
|
|
|
|
|
2022-04-20 12:35:53 -07:00
|
|
|
mock-tests:
|
2022-01-31 14:01:34 -08:00
|
|
|
needs: lint
|
2023-10-03 18:38:58 -07:00
|
|
|
runs-on: ubuntu-latest-8-cores
|
2022-01-31 14:01:34 -08:00
|
|
|
if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }}
|
2022-02-24 17:21:56 -08:00
|
|
|
timeout-minutes: 30
|
2022-01-31 14:01:34 -08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Get system specs
|
|
|
|
run: lsb_release -a
|
|
|
|
- name: Get other system specs
|
|
|
|
run: uname -a
|
|
|
|
|
|
|
|
- name: Clone Desktop repo
|
2022-06-17 13:47:57 +01:00
|
|
|
uses: actions/checkout@v3
|
2022-01-31 14:01:34 -08:00
|
|
|
|
|
|
|
- name: Setup node.js
|
2022-06-17 13:47:57 +01:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-31 14:01:34 -08:00
|
|
|
with:
|
2024-02-22 13:19:37 -08:00
|
|
|
node-version: '20.9.0'
|
2022-01-31 14:01:34 -08:00
|
|
|
- name: Install global dependencies
|
2024-01-23 16:11:12 -08:00
|
|
|
run: npm install -g yarn@1.22.10 npm@10.2.5
|
2022-01-31 14:01:34 -08:00
|
|
|
|
|
|
|
- name: Install xvfb
|
|
|
|
run: sudo apt-get install xvfb
|
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 13:47:57 +01:00
|
|
|
uses: actions/cache@v3
|
2022-01-31 14:01:34 -08:00
|
|
|
with:
|
|
|
|
path: node_modules
|
|
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
|
|
|
|
|
|
|
- name: Install Desktop node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --frozen-lockfile
|
2022-11-16 17:38:25 -08:00
|
|
|
env:
|
|
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
2022-01-31 14:01:34 -08:00
|
|
|
|
|
|
|
- name: Build typescript
|
|
|
|
run: yarn generate
|
|
|
|
- name: Bundle
|
2023-03-15 17:59:30 -07:00
|
|
|
run: yarn build:esbuild:prod
|
2022-01-31 14:01:34 -08:00
|
|
|
|
2022-04-20 12:35:53 -07:00
|
|
|
- name: Run mock server tests
|
2022-01-31 14:01:34 -08:00
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2022-02-11 14:32:51 -08:00
|
|
|
xvfb-run --auto-servernum yarn test-mock
|
2022-01-31 14:01:34 -08:00
|
|
|
timeout-minutes: 10
|
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
2022-04-20 12:35:53 -07:00
|
|
|
DEBUG: mock:test:*
|
2022-07-08 13:46:25 -07:00
|
|
|
ARTIFACTS_DIR: artifacts/startup
|
|
|
|
|
|
|
|
- name: Upload mock server test logs on failure
|
|
|
|
if: failure()
|
2023-02-08 09:14:59 -08:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-07-08 13:46:25 -07:00
|
|
|
with:
|
|
|
|
name: logs
|
|
|
|
path: artifacts
|