Skip to content

Commit

Permalink
merege dev
Browse files Browse the repository at this point in the history
  • Loading branch information
InfamousVague committed Oct 14, 2024
2 parents 92d4d54 + 778a1a0 commit ebd994d
Show file tree
Hide file tree
Showing 44 changed files with 2,121 additions and 971 deletions.
137 changes: 104 additions & 33 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ on:
jobs:
playwright-run:
timeout-minutes: 60
runs-on: macos-latest
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.0-jammy
strategy:
fail-fast: false
matrix:
project: ["desktop-chrome", "mobile-chrome"]
permissions:
checks: write
pull-requests: write
Expand All @@ -41,41 +47,26 @@ jobs:

- name: Install dependencies for Testing Repo 📦
working-directory: automated-tests
run: npm install

- name: Install Playwright Browsers
working-directory: automated-tests
run: npx playwright install --with-deps

- name: Run server for Uplink Web
run: npm run dev &
run: npm ci

- name: Run Playwright tests
working-directory: automated-tests
run: PLAYWRIGHT_JSON_OUTPUT_NAME=report.json npx playwright test

- uses: daun/playwright-report-summary@v3
if: always()
with:
github-token: ${{ secrets.github_token }}
report-file: ./automated-tests/playwright-report/report.json
job-summary: false
comment-title: "Automated Test Results"
run: npx playwright test -c playwright.ci.config.ts --project=${{ matrix.project }}

- uses: actions/[email protected]
if: always()
with:
name: playwright-report
path: automated-tests/playwright-report/
retention-days: 5
name: playwright-report-${{ matrix.project }}
path: automated-tests/blob-report/
retention-days: 1

- name: Upload Allure results as artifact
if: always()
uses: actions/[email protected]
with:
name: allure-results
name: allure-results-${{ matrix.project }}
path: automated-tests/allure-results
retention-days: 5
retention-days: 1

- name: Add label if any of build jobs failed
if: failure()
Expand All @@ -86,21 +77,94 @@ jobs:
Failed Automated Test
type: add

generate-report:
merge-reports:
if: always()
needs: playwright-run
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.48.0-jammy
steps:
- name: Download Blob Report from Desktop
uses: actions/download-artifact@v4
with:
name: playwright-report-desktop-chrome
path: blob-report

- name: Download Blob Report from Mobile
uses: actions/download-artifact@v4
with:
name: playwright-report-mobile-chrome
path: blob-report

- name: Merge Blob Reports into HTML Report
run: npx playwright merge-reports --reporter html ./blob-report

- name: Upload Merged Report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-merged-report
path: playwright-report
retention-days: 5

- name: Delete temporary artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: |
playwright-report-desktop-chrome
playwright-report-mobile-chrome
publish-report:
if: always()
needs: merge-reports
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: write
issues: read
steps:
- name: Download Allure results artifact
- name: Download Merged Report
uses: actions/download-artifact@v4
with:
name: playwright-merged-report
path: playwright-report

- name: Set a timestamp one
id: timestampidone
run: echo "timestamp=$(date --utc +%Y%m%d_%H%M%SZ)" >> "$GITHUB_OUTPUT"

- name: Deploy Playwright HTML report to Github Pages
if: success()
uses: peaceiris/actions-gh-pages@v4
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: Satellite-im/test-reports
keep_files: true
publish_branch: gh-pages
publish_dir: ./playwright-report
destination_dir: ${{ steps.timestampidone.outputs.timestamp }}

- name: Stop ssh-agent job from first deploy required for deploying a second time
run: killall ssh-agent

- name: Download Allure results artifact for desktop
uses: actions/[email protected]
with:
name: allure-results
path: automated-tests/allure
name: allure-results-desktop-chrome
path: allure/desktop-chrome

- name: Download Allure results artifact for mobile
uses: actions/[email protected]
with:
name: allure-results-mobile-chrome
path: allure/mobile-chrome

- name: Merge Allure results
run: |
mkdir -p allure-results
cp -r allure/desktop-chrome/* allure-results/
cp -r allure/mobile-chrome/* allure-results/
- name: Get Allure history
uses: actions/[email protected]
Expand All @@ -116,10 +180,16 @@ jobs:
uses: simple-elf/allure-report-action@master
with:
gh_pages: gh-pages
allure_results: automated-tests/allure
allure_results: allure-results
allure_report: allure-report
allure_history: allure-history
keep_reports: 100
github_repo: Satellite-im/test-reports
github_repo_owner: Satellite-im

- name: Set a timestamp two
id: timestampidtwo
run: echo "timestamp=$(date --utc +%Y%m%d_%H%M%SZ)" >> "$GITHUB_OUTPUT"

- name: Deploy report to Github Pages
if: success()
Expand All @@ -128,19 +198,19 @@ jobs:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
external_repository: Satellite-im/test-reports
publish_branch: gh-pages
publish_dir: allure-history
publish_dir: ./allure-history

- name: Comment PR with Allure test results
if: always() && github.event_name == 'pull_request'
uses: mshick/[email protected]
with:
message: |
Playwright test execution is complete! You can find the test results report [here](https://satellite-im.github.io/test-reports/${{ github.run_number }})
Automated tests execution is complete! You can find the Playwright test report [here](https://satellite-im.github.io/test-reports/${{ steps.timestampidone.outputs.timestamp }}/) and the Allure Test Report [here](https://satellite-im.github.io/test-reports/${{ github.run_number }})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

remove-label:
needs: [playwright-run, generate-report]
needs: [playwright-run, merge-reports, publish-report]
runs-on: ubuntu-latest
permissions:
checks: write
Expand All @@ -156,8 +226,9 @@ jobs:
uses: geekyeggo/[email protected]
with:
name: |
playwright-report
allure-results
playwright-merged-report
allure-results-desktop-chrome
allure-results-mobile-chrome
- name: Remove label if all test jobs succeeded
uses: buildsville/[email protected]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"svelte-highlight": "^7.6.1",
"svelte-i18n": "^4.0.0",
"svelte-markdown": "^0.4.1",
"trystero": "^0.20.0",
"three": "0.169.0",
"uuid": "10.0.0",
"vite-plugin-node-polyfills": "0.22.0",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/calling/CallControls.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
$: activeCall = Store.state.activeCall
$: activeChat = Store.state.activeChat
$: pending = settings.calling.minimalCallingAlerts && VoiceRTCInstance.isReceivingCall
$: pending = settings.calling.minimalCallingAlerts && VoiceRTCInstance.incomingCallFrom != null
</script>

{#if $activeCall || pending}
Expand Down Expand Up @@ -121,7 +121,7 @@
loading={loading}
on:click={_ => {
Store.endCall()
VoiceRTCInstance.endCall()
VoiceRTCInstance.leaveCall()
}}>
<Icon icon={Shape.PhoneXMark} />
</Button>
Expand Down
Loading

0 comments on commit ebd994d

Please sign in to comment.