Skip to content

Commit

Permalink
Merge from develop
Browse files Browse the repository at this point in the history
  • Loading branch information
islathehut committed May 13, 2024
2 parents af7844b + bbe6350 commit d284757
Show file tree
Hide file tree
Showing 321 changed files with 5,413 additions and 8,174 deletions.
15 changes: 15 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ runs:
- uses: actions/setup-node@master
with:
node-version: 18.12.1

- name: Set up Python 3.12
uses: actions/setup-python@v5
if: runner.os == 'macOS'
with:
python-version: 3.12

- name: Print python version
run: which python3
if: runner.os == 'macOS'
shell: bash

- name: Install setuptools
run: python3 -m pip install setuptools
shell: bash

- name: Print OS name
run: echo ${{ runner.os }}
Expand Down
52 changes: 49 additions & 3 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,43 @@ name: Backend unit tests

on:
pull_request:
paths:
- packages/backend/**

jobs:
unit-tests:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-20.04, macos-latest, windows-2019]
os: [ubuntu-20.04, macos-12, windows-2019]

steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
backend:
- 'packages/backend/**'
- name: "Skip tests"
if: steps.filter.outputs.backend == 'false'
run: |
echo "Skipping test run"
exit 0
- name: "Print OS"
if: steps.filter.outputs.backend == 'true'
run: echo ${{ matrix.os }}

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: steps.filter.outputs.backend == 'true'

- name: "Setup environment"
if: steps.filter.outputs.backend == 'true'
uses: ./.github/actions/setup-env
with:
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,backend-bundle"

- name: "Unit tests"
if: steps.filter.outputs.backend == 'true'
run: lerna run test-ci --scope @quiet/backend --stream

long-running-tests:
Expand All @@ -35,17 +49,33 @@ jobs:
os: [ubuntu-20.04]

steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
backend:
- 'packages/backend/**'
- name: "Skip tests"
if: steps.filter.outputs.backend == 'false'
run: |
echo "Skipping test run"
exit 0
- name: "Print OS"
if: steps.filter.outputs.backend == 'true'
run: echo ${{ matrix.os }}

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: steps.filter.outputs.backend == 'true'

- name: "Setup environment"
if: steps.filter.outputs.backend == 'true'
uses: ./.github/actions/setup-env
with:
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,backend-bundle"

- name: "Unit tests"
if: steps.filter.outputs.backend == 'true'
run: lerna run test-ci-long-running --scope @quiet/backend --stream

unit-tests-with-tor:
Expand All @@ -56,15 +86,31 @@ jobs:
os: [ubuntu-20.04]

steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
backend:
- 'packages/backend/**'
- name: "Skip tests"
if: steps.filter.outputs.backend == 'false'
run: |
echo "Skipping test run"
exit 0
- name: "Print OS"
if: steps.filter.outputs.backend == 'true'
run: echo ${{ matrix.os }}

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: steps.filter.outputs.backend == 'true'

- name: "Setup environment"
if: steps.filter.outputs.backend == 'true'
uses: ./.github/actions/setup-env
with:
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,backend-bundle"

- name: "Unit tests"
if: steps.filter.outputs.backend == 'true'
run: lerna run test-ci-tor --scope @quiet/backend --stream
18 changes: 16 additions & 2 deletions .github/workflows/check-desktop-visual-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Desktop visual regressions

on:
pull_request:
paths:
- packages/desktop/**

jobs:
chromatic-deployment:
Expand All @@ -14,20 +12,36 @@ jobs:
os: [ubuntu-20.04]

steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
desktop:
- 'packages/desktop/**'
- name: "Skip tests"
if: steps.filter.outputs.desktop == 'false'
run: |
echo "Skipping test run"
exit 0
- name: "Print OS"
if: steps.filter.outputs.desktop == 'true'
run: echo ${{ matrix.os }}

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: steps.filter.outputs.desktop == 'true'
with:
fetch-depth: 0 # Required to retrieve git history

- name: Setup environment
uses: ./.github/actions/setup-env
if: steps.filter.outputs.desktop == 'true'
with:
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"

- name: "Publish to Chromatic"
uses: chromaui/action@355e2a05a179e9e89c2b237dcd55adbeb89e577e # v1
if: steps.filter.outputs.desktop == 'true'
with:
workingDir: ./packages/desktop
token: ${{ secrets.GH_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/desktop-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:

build-macos:
# needs: run-e2e-tests-mac
runs-on: macos-latest
runs-on: macos-12
if: |
startsWith(github.ref, 'refs/tags/@quiet/desktop')
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/desktop-rtl-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Desktop - state-manager bracket tests (RTL)

on:
pull_request:
paths:
- packages/desktop/**
- packages/state-manager/**

jobs:
desktop-tests:
Expand All @@ -13,19 +10,36 @@ jobs:

strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-20.04, macos-12]

steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
validFiles:
- 'packages/desktop/**'
- 'packages/state-manger/**'
- name: "Skip tests"
if: steps.filter.outputs.validFiles == 'false'
run: |
echo "Skipping test run"
exit 0
- name: "Print OS"
if: steps.filter.outputs.validFiles == 'true'
run: echo ${{ matrix.os }}

- uses: actions/checkout@v3
if: steps.filter.outputs.validFiles == 'true'

- name: "Setup environment"
uses: ./.github/actions/setup-env
if: steps.filter.outputs.validFiles == 'true'
with:
cachePrefix: "desktop-tests"
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"

- name: "Desktop - state-manager bracket tests"
if: steps.filter.outputs.validFiles == 'true'
run: lerna run rtl-test --scope @quiet/desktop --stream
22 changes: 19 additions & 3 deletions .github/workflows/desktop-test-scroll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Desktop scroll regression tests

on:
pull_request:
paths:
- packages/desktop/**

jobs:
regression-tests:
Expand All @@ -15,31 +13,49 @@ jobs:
os: [ubuntu-20.04]

steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
desktop:
- 'packages/desktop/**'
- name: "Skip tests"
if: steps.filter.outputs.desktop == 'false'
run: |
echo "Skipping test run"
exit 0
- name: "Print OS"
if: steps.filter.outputs.desktop == 'true'
run: echo ${{ matrix.os }}

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: steps.filter.outputs.desktop == 'true'

- name: Setup environment
uses: ./.github/actions/setup-env
if: steps.filter.outputs.desktop == 'true'
with:
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"

- name: "Install libs"
if: steps.filter.outputs.desktop == 'true'
run: sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

- name: "Remove test files workaround"
if: steps.filter.outputs.desktop == 'true'
run: find packages/desktop/src -name '*.test.*' -delete && find packages/backend/src -name '*.test.*' -delete

- uses: cypress-io/github-action@1b70233146622b69e789ccdd4f9452adc638d25a # v6.6.1
if: steps.filter.outputs.desktop == 'true'
with:
install: false
command: npm run regression-test:ci
working-directory: packages/desktop

- name: Archive test screenshots
if: steps.filter.outputs.desktop == 'true'
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: always()
with:
name: test-screenshots-linux
path: packages/desktop/cypress/snapshots
20 changes: 17 additions & 3 deletions .github/workflows/desktop-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Desktop tests

on:
pull_request:
paths:
- packages/desktop/**

jobs:
desktop-tests:
Expand All @@ -12,19 +10,35 @@ jobs:

strategy:
matrix:
os: [ubuntu-20.04, macos-latest]
os: [ubuntu-20.04, macos-12]

steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
desktop:
- 'packages/desktop/**'
- name: "Skip tests"
if: steps.filter.outputs.desktop == 'false'
run: |
echo "Skipping test run"
exit 0
- name: "Print OS"
if: steps.filter.outputs.desktop == 'true'
run: echo ${{ matrix.os }}

- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: steps.filter.outputs.desktop == 'true'

- name: "Setup environment"
uses: ./.github/actions/setup-env
if: steps.filter.outputs.desktop == 'true'
with:
cachePrefix: "desktop-tests"
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/desktop,backend-bundle"

- name: "Unit tests"
if: steps.filter.outputs.desktop == 'true'
run: lerna run test --scope @quiet/desktop --stream
Loading

0 comments on commit d284757

Please sign in to comment.