Skip to content

Commit

Permalink
Update required contextual actions to run and exit early when no rele…
Browse files Browse the repository at this point in the history
…vant changes found (#2488)
  • Loading branch information
ikoenigsknecht committed May 7, 2024
1 parent 2c11121 commit dde5d34
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 16 deletions.
50 changes: 48 additions & 2 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Backend unit tests

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

jobs:
unit-tests:
Expand All @@ -14,17 +12,33 @@ jobs:
os: [ubuntu-20.04, macos-latest, 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
20 changes: 17 additions & 3 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 @@ -16,16 +13,33 @@ jobs:
os: [ubuntu-20.04, macos-latest]

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
18 changes: 16 additions & 2 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 @@ -15,16 +13,32 @@ jobs:
os: [ubuntu-20.04, macos-latest]

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
18 changes: 16 additions & 2 deletions .github/workflows/identity-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Identity tests

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

jobs:
identity-tests:
Expand All @@ -15,15 +13,31 @@ jobs:
os: [ubuntu-20.04, macos-latest, windows-2019]

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

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

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

- name: "Unit tests"
if: steps.filter.outputs.identity == 'true'
run: lerna run test --scope @quiet/identity --stream
18 changes: 16 additions & 2 deletions .github/workflows/state-manager-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: State-manager tests

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

jobs:
state-manager-tests:
Expand All @@ -15,15 +13,31 @@ jobs:
os: [ubuntu-20.04, macos-latest]

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

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

- name: "Setup environment"
uses: ./.github/actions/setup-env
if: steps.filter.outputs.stateManager == '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: "Unit tests"
if: steps.filter.outputs.stateManager == 'true'
run: lerna run test --scope @quiet/state-manager --stream
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# Fixes:

* Update github workflows for PR gating ([#2487](https://github.com/TryQuiet/quiet/issues/2487))
* Don't create duplicate CSRs when joining a community under certain circumstances ([#2321](https://github.com/TryQuiet/quiet/issues/2321))

[2.2.0]
Expand Down

0 comments on commit dde5d34

Please sign in to comment.