343 lines
9.1 KiB
YAML
343 lines
9.1 KiB
YAML
# Copyright 2020 Signal Messenger, LLC
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
name: CI
|
|
on:
|
|
push:
|
|
branches:
|
|
- development
|
|
- main
|
|
- '[0-9]+.[0-9]+.x'
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest-8-cores
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- run: lsb_release -a
|
|
- run: uname -a
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18.18.2'
|
|
- run: npm install -g yarn@1.22.10 npm@10.2.5
|
|
|
|
- name: Cache Desktop node_modules
|
|
id: cache-desktop-modules
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
|
|
|
|
- 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') }}
|
|
|
|
- name: Install Desktop node_modules
|
|
if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
|
|
run: yarn install --frozen-lockfile
|
|
env:
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
|
|
|
- run: yarn generate
|
|
- run: yarn lint
|
|
- run: yarn lint-deps
|
|
- run: yarn lint-license-comments
|
|
- run: git diff --exit-code
|
|
|
|
- name: Update cached .eslintcache and tsconfig.tsbuildinfo
|
|
uses: actions/cache/save@v3
|
|
if: github.ref == 'refs/heads/main'
|
|
with:
|
|
path: |
|
|
.eslintcache
|
|
tsconfig.tsbuildinfo
|
|
key: ${{ steps.cache-lint.outputs.cache-primary-key }}
|
|
|
|
macos:
|
|
needs: lint
|
|
runs-on: macos-latest
|
|
if: github.ref == 'refs/heads/main'
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- run: uname -a
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18.18.2'
|
|
|
|
- run: npm install -g yarn@1.22.10 npm@10.2.5
|
|
|
|
- name: Cache Desktop node_modules
|
|
id: cache-desktop-modules
|
|
uses: actions/cache@v3
|
|
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
|
|
env:
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
|
|
|
- run: yarn generate
|
|
- run: yarn prepare-beta-build
|
|
- run: yarn test-node
|
|
- run: yarn test-electron
|
|
env:
|
|
ARTIFACTS_DIR: artifacts/macos
|
|
timeout-minutes: 5
|
|
- run: touch noop.sh && chmod +x noop.sh
|
|
- run: yarn build
|
|
env:
|
|
DISABLE_INSPECT_FUSE: on
|
|
SIGN_MACOS_SCRIPT: noop.sh
|
|
- name: Rebuild native modules for x64
|
|
run: yarn electron:install-app-deps
|
|
- run: yarn test-release
|
|
env:
|
|
NODE_ENV: production
|
|
- run: yarn test-eslint
|
|
|
|
- name: Upload artifacts on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
path: artifacts
|
|
|
|
linux:
|
|
needs: lint
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
|
|
steps:
|
|
- run: lsb_release -a
|
|
- run: uname -a
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18.18.2'
|
|
- run: sudo apt-get install xvfb
|
|
|
|
- run: npm install -g yarn@1.22.10 npm@10.2.5
|
|
|
|
- name: Cache Desktop node_modules
|
|
id: cache-desktop-modules
|
|
uses: actions/cache@v3
|
|
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
|
|
env:
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
|
|
|
- run: yarn generate
|
|
- run: yarn prepare-beta-build
|
|
|
|
- name: Create bundle
|
|
run: yarn build:esbuild:prod
|
|
|
|
- name: Build with packaging .deb file
|
|
run: yarn build:release -- --publish=never
|
|
if: github.ref == 'refs/heads/main'
|
|
env:
|
|
DISABLE_INSPECT_FUSE: on
|
|
- name: Build without packaging .deb file
|
|
run: yarn build:release --linux dir
|
|
if: github.ref != 'refs/heads/main'
|
|
env:
|
|
DISABLE_INSPECT_FUSE: on
|
|
|
|
- run: xvfb-run --auto-servernum yarn test-node
|
|
- run: xvfb-run --auto-servernum yarn test-electron
|
|
timeout-minutes: 5
|
|
env:
|
|
ARTIFACTS_DIR: artifacts/linux
|
|
LANG: en_US
|
|
LANGUAGE: en_US
|
|
- run: xvfb-run --auto-servernum yarn test-release
|
|
env:
|
|
NODE_ENV: production
|
|
|
|
- name: Upload artifacts on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
path: artifacts
|
|
|
|
windows:
|
|
needs: lint
|
|
runs-on: windows-2019
|
|
timeout-minutes: 30
|
|
|
|
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"
|
|
|
|
steps:
|
|
- run: systeminfo
|
|
- run: git config --global core.autocrlf false
|
|
- run: git config --global core.eol lf
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18.18.2'
|
|
- run: npm install -g yarn@1.22.10 npm@10.2.5 node-gyp@10.0.1
|
|
|
|
# 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"
|
|
|
|
- name: Cache Desktop node_modules
|
|
id: cache-desktop-modules
|
|
uses: actions/cache@v3
|
|
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
|
|
env:
|
|
CHILD_CONCURRENCY: 1
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
|
|
|
- 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
|
|
|
|
- name: Create bundle
|
|
run: yarn build:esbuild:prod
|
|
|
|
- name: Build with NSIS
|
|
run: yarn build:release
|
|
if: github.ref == 'refs/heads/main'
|
|
env:
|
|
DISABLE_INSPECT_FUSE: on
|
|
- name: Build without NSIS
|
|
run: yarn build:release --win dir
|
|
if: github.ref != 'refs/heads/main'
|
|
env:
|
|
DISABLE_INSPECT_FUSE: on
|
|
|
|
- run: yarn test-electron
|
|
env:
|
|
ARTIFACTS_DIR: artifacts/windows
|
|
timeout-minutes: 5
|
|
- run: yarn test-release
|
|
env:
|
|
SIGNAL_ENV: production
|
|
|
|
- name: Upload artifacts on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
path: artifacts
|
|
|
|
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
|
|
|
|
mock-tests:
|
|
needs: lint
|
|
runs-on: ubuntu-latest-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@v3
|
|
|
|
- name: Setup node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18.18.2'
|
|
- name: Install global dependencies
|
|
run: npm install -g yarn@1.22.10 npm@10.2.5
|
|
|
|
- name: Install xvfb
|
|
run: sudo apt-get install xvfb
|
|
|
|
- name: Cache Desktop node_modules
|
|
id: cache-desktop-modules
|
|
uses: actions/cache@v3
|
|
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
|
|
env:
|
|
NPM_CONFIG_LOGLEVEL: verbose
|
|
|
|
- name: Build typescript
|
|
run: yarn generate
|
|
- name: Bundle
|
|
run: yarn build:esbuild:prod
|
|
|
|
- name: Run mock server tests
|
|
run: |
|
|
set -o pipefail
|
|
xvfb-run --auto-servernum yarn test-mock
|
|
timeout-minutes: 10
|
|
env:
|
|
NODE_ENV: production
|
|
DEBUG: mock:test:*
|
|
ARTIFACTS_DIR: artifacts/startup
|
|
|
|
- name: Upload mock server test logs on failure
|
|
if: failure()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: logs
|
|
path: artifacts
|