2022-02-18 21:58:49 +00:00
|
|
|
# Copyright 2020-2022 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-03-18 17:50:20 +00:00
|
|
|
name: CI
|
2021-12-23 18:50:07 +00:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- development
|
2022-04-25 22:53:31 +00:00
|
|
|
- main
|
2021-12-23 18:50:07 +00:00
|
|
|
- '[0-9]+.[0-9]+.x'
|
|
|
|
pull_request:
|
2020-03-18 17:50:20 +00:00
|
|
|
|
|
|
|
jobs:
|
2020-03-20 17:33:55 +00:00
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
2022-02-25 01:21:56 +00:00
|
|
|
timeout-minutes: 30
|
2020-03-20 17:33:55 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- run: lsb_release -a
|
|
|
|
- run: uname -a
|
2022-06-17 12:47:57 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2020-03-20 17:33:55 +00:00
|
|
|
with:
|
2022-08-29 22:40:57 +00:00
|
|
|
node-version: '16.15.0'
|
2021-04-05 20:37:23 +00:00
|
|
|
- run: npm install -g yarn@1.22.10
|
2021-04-13 22:39:46 +00:00
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 12:47:57 +00:00
|
|
|
uses: actions/cache@v3
|
2021-04-13 22:39:46 +00:00
|
|
|
with:
|
|
|
|
path: node_modules
|
2021-11-23 22:00:44 +00:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
2021-04-13 22:39:46 +00:00
|
|
|
- name: Install Desktop node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
2020-03-20 17:33:55 +00:00
|
|
|
- run: yarn generate
|
|
|
|
- run: yarn lint
|
|
|
|
- run: yarn lint-deps
|
2021-01-07 21:39:17 +00:00
|
|
|
# - run: yarn lint-license-comments
|
2020-12-01 16:42:35 +00:00
|
|
|
- run: git diff --exit-code
|
2020-03-20 17:33:55 +00:00
|
|
|
|
2020-03-18 17:50:20 +00:00
|
|
|
macos:
|
2020-03-20 17:33:55 +00:00
|
|
|
needs: lint
|
2022-09-01 16:35:44 +00:00
|
|
|
runs-on: macos-latest
|
2022-04-25 22:53:31 +00:00
|
|
|
if: github.ref == 'refs/heads/development' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
|
2022-02-25 01:21:56 +00:00
|
|
|
timeout-minutes: 30
|
2020-03-18 17:50:20 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- run: uname -a
|
2022-06-17 12:47:57 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2020-03-18 17:50:20 +00:00
|
|
|
with:
|
2022-08-29 22:40:57 +00:00
|
|
|
node-version: '16.15.0'
|
2021-04-05 20:37:23 +00:00
|
|
|
- run: npm install -g yarn@1.22.10
|
2021-04-13 22:39:46 +00:00
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 12:47:57 +00:00
|
|
|
uses: actions/cache@v3
|
2021-04-13 22:39:46 +00:00
|
|
|
with:
|
|
|
|
path: node_modules
|
2021-11-23 22:00:44 +00:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
2021-04-13 22:39:46 +00:00
|
|
|
- name: Install Desktop node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
2020-03-18 17:50:20 +00:00
|
|
|
- run: yarn generate
|
|
|
|
- run: yarn prepare-beta-build
|
|
|
|
- run: yarn build
|
2021-12-17 17:50:42 +00:00
|
|
|
env:
|
|
|
|
DISABLE_INSPECT_FUSE: on
|
2021-12-03 22:49:15 +00:00
|
|
|
- name: Rebuild native modules for x64
|
|
|
|
run: yarn electron:install-app-deps
|
2020-03-18 17:50:20 +00:00
|
|
|
- run: yarn test-node
|
|
|
|
- run: yarn test-electron
|
2022-02-25 01:21:56 +00:00
|
|
|
timeout-minutes: 5
|
2021-12-09 08:06:04 +00:00
|
|
|
- run: yarn test-release
|
2020-03-18 17:50:20 +00:00
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
|
|
|
|
|
|
|
linux:
|
2020-03-20 17:33:55 +00:00
|
|
|
needs: lint
|
2020-03-18 17:50:20 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-02-25 01:21:56 +00:00
|
|
|
timeout-minutes: 30
|
2020-03-18 17:50:20 +00:00
|
|
|
|
|
|
|
steps:
|
2020-03-20 17:33:55 +00:00
|
|
|
- run: lsb_release -a
|
2020-03-18 17:50:20 +00:00
|
|
|
- run: uname -a
|
2022-06-17 12:47:57 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2020-03-18 17:50:20 +00:00
|
|
|
with:
|
2022-08-29 22:40:57 +00:00
|
|
|
node-version: '16.15.0'
|
2020-03-18 17:50:20 +00:00
|
|
|
- run: sudo apt-get install xvfb
|
2021-04-05 20:37:23 +00:00
|
|
|
- run: npm install -g yarn@1.22.10
|
2021-04-13 22:39:46 +00:00
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 12:47:57 +00:00
|
|
|
uses: actions/cache@v3
|
2021-04-13 22:39:46 +00:00
|
|
|
with:
|
|
|
|
path: node_modules
|
2021-11-23 22:00:44 +00:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
2021-04-13 22:39:46 +00:00
|
|
|
- name: Install Desktop node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
2020-03-18 17:50:20 +00:00
|
|
|
- run: yarn generate
|
|
|
|
- run: yarn prepare-beta-build
|
|
|
|
- run: yarn build
|
2021-12-17 17:50:42 +00:00
|
|
|
env:
|
|
|
|
DISABLE_INSPECT_FUSE: on
|
2020-03-18 17:50:20 +00:00
|
|
|
- run: xvfb-run --auto-servernum yarn test-node
|
|
|
|
- run: xvfb-run --auto-servernum yarn test-electron
|
2022-02-25 01:21:56 +00:00
|
|
|
timeout-minutes: 5
|
2020-03-18 17:50:20 +00:00
|
|
|
env:
|
|
|
|
LANG: en_US
|
|
|
|
LANGUAGE: en_US
|
2021-12-09 08:06:04 +00:00
|
|
|
- run: xvfb-run --auto-servernum yarn test-release
|
2020-03-18 17:50:20 +00:00
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
|
|
|
|
|
|
|
windows:
|
2020-03-20 17:33:55 +00:00
|
|
|
needs: lint
|
2022-04-08 07:18:55 +00:00
|
|
|
runs-on: windows-latest
|
2022-02-25 01:21:56 +00:00
|
|
|
timeout-minutes: 30
|
2020-03-18 17:50:20 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- run: systeminfo
|
|
|
|
- run: git config --global core.autocrlf false
|
|
|
|
- run: git config --global core.eol lf
|
2022-06-17 12:47:57 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2020-03-18 17:50:20 +00:00
|
|
|
with:
|
2022-08-29 22:40:57 +00:00
|
|
|
node-version: '16.15.0'
|
2021-04-05 20:37:23 +00:00
|
|
|
- run: npm install -g yarn@1.22.10
|
2021-04-13 22:39:46 +00:00
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 12:47:57 +00:00
|
|
|
uses: actions/cache@v3
|
2021-04-13 22:39:46 +00:00
|
|
|
with:
|
|
|
|
path: node_modules
|
2021-11-23 22:00:44 +00:00
|
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
2021-04-13 22:39:46 +00:00
|
|
|
- name: Install Desktop node_modules
|
|
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
|
2020-03-18 17:50:20 +00: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
|
|
|
|
- run: yarn build
|
2021-12-17 17:50:42 +00:00
|
|
|
env:
|
|
|
|
DISABLE_INSPECT_FUSE: on
|
2021-12-09 08:06:04 +00:00
|
|
|
- run: yarn test-electron
|
2022-02-25 01:21:56 +00:00
|
|
|
timeout-minutes: 5
|
2021-12-09 08:06:04 +00:00
|
|
|
- run: yarn test-release
|
2020-03-18 17:50:20 +00:00
|
|
|
env:
|
|
|
|
SIGNAL_ENV: production
|
2022-01-31 22:01:34 +00:00
|
|
|
|
2022-04-20 19:35:53 +00:00
|
|
|
mock-tests:
|
2022-01-31 22:01:34 +00:00
|
|
|
needs: lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
if: ${{ github.repository == 'signalapp/Signal-Desktop-Private' }}
|
2022-02-25 01:21:56 +00:00
|
|
|
timeout-minutes: 30
|
2022-01-31 22:01:34 +00: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 12:47:57 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-01-31 22:01:34 +00:00
|
|
|
|
|
|
|
- name: Setup node.js
|
2022-06-17 12:47:57 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-31 22:01:34 +00:00
|
|
|
with:
|
2022-08-29 22:40:57 +00:00
|
|
|
node-version: '16.15.0'
|
2022-01-31 22:01:34 +00:00
|
|
|
- name: Install global dependencies
|
|
|
|
run: npm install -g yarn@1.22.10
|
|
|
|
|
|
|
|
- name: Install xvfb
|
|
|
|
run: sudo apt-get install xvfb
|
|
|
|
|
|
|
|
- name: Cache Desktop node_modules
|
|
|
|
id: cache-desktop-modules
|
2022-06-17 12:47:57 +00:00
|
|
|
uses: actions/cache@v3
|
2022-01-31 22:01:34 +00: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
|
|
|
|
|
|
|
|
- name: Build typescript
|
|
|
|
run: yarn generate
|
|
|
|
- name: Bundle
|
|
|
|
run: yarn build:webpack
|
|
|
|
|
2022-04-20 19:35:53 +00:00
|
|
|
- name: Run mock server tests
|
2022-01-31 22:01:34 +00:00
|
|
|
run: |
|
|
|
|
set -o pipefail
|
2022-02-11 22:32:51 +00:00
|
|
|
xvfb-run --auto-servernum yarn test-mock
|
2022-01-31 22:01:34 +00:00
|
|
|
timeout-minutes: 10
|
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
2022-04-20 19:35:53 +00:00
|
|
|
DEBUG: mock:test:*
|
2022-07-08 20:46:25 +00:00
|
|
|
ARTIFACTS_DIR: artifacts/startup
|
|
|
|
|
|
|
|
- name: Upload mock server test logs on failure
|
|
|
|
if: failure()
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: logs
|
|
|
|
path: artifacts
|