Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add integ test run on pull requests/push to staging/prod #105

Merged
merged 4 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/desktop-linux-test-pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: 'Desktop-Linux full test suite run on pull request'
on: [pull_request]

concurrency:
group: pr-desktop-linux-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
test-desktop-linux:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: install dependencies (ubuntu only)
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
sudo apt install build-essential curl wget file libssl-dev libayatana-appindicator3-dev
sudo apt-get install xvfb

- name: npm install ci deps
run: npm ci

- name: Download phoenix and build build phoenix dist-test
run: |
npm run _ci-clonePhoenixForTests
cd ..
cd phoenix
npm ci
npm run build
npm run release:dev

- name: build test runner
run: |
npm ci
npm run releaseDistTestDebug

- name: Run tauri unit tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 12
max_attempts: 3
command: xvfb-run ./src-tauri/target/debug/phoenix-test --run-tests=unit -q

- name: Run tauri integration tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 12
max_attempts: 3
command: xvfb-run ./src-tauri/target/debug/phoenix-test --run-tests=integration -q

- name: Run tauri mainview tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 12
max_attempts: 3
command: xvfb-run ./src-tauri/target/debug/phoenix-test --run-tests=mainview -q

- name: Run tauri LegacyInteg tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 3
command: xvfb-run ./src-tauri/target/debug/phoenix-test --run-tests=LegacyInteg -q
64 changes: 64 additions & 0 deletions .github/workflows/desktop-mac-test-pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 'Desktop-mac full test suite run on pull request'
on: [pull_request]

concurrency:
group: pr-desktop-mac-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
test-desktop-mac:
runs-on: macos-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: npm install ci deps
run: npm ci

- name: Download phoenix and build build phoenix dist-test
run: |
npm run _ci-clonePhoenixForTests
cd ..
cd phoenix
npm ci
npm run build
npm run release:dev

- name: build test runner
run: |
npm ci
npm run releaseDistTestDebug

- name: Run tauri unit tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 12
max_attempts: 3
command: ./src-tauri/target/debug/phoenix-test --run-tests=unit -q

- name: Run tauri integration tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 12
max_attempts: 3
command: ./src-tauri/target/debug/phoenix-test --run-tests=integration -q

- name: Run tauri mainview tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 12
max_attempts: 3
command: ./src-tauri/target/debug/phoenix-test --run-tests=mainview -q

- name: Run tauri LegacyInteg tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 30
max_attempts: 3
command: ./src-tauri/target/debug/phoenix-test --run-tests=LegacyInteg -q
100 changes: 100 additions & 0 deletions .github/workflows/desktop-windows-test-pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: 'Desktop-Windows full test suite run on pull request'
on: [pull_request]

concurrency:
group: pr-desktop-windows-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
test-desktop-windows:
runs-on: windows-latest
timeout-minutes: 90
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable

- name: npm install ci deps
run: npm ci

- name: Download phoenix and build build phoenix dist-test
run: |
npm run _ci-clonePhoenixForTests
cd ..
cd phoenix
npm ci
npm run build
npm run release:dev

- name: build test runner
run: |
npm ci
npm run releaseDistTestDebug

- name: Run tauri unit tests in windows
# GUI apps in windows doesn't log on console. so we capture the output to a text file and print it, then fail on error.
uses: nick-fields/retry@v2
id: windowsRunUnit
continue-on-error: true
with:
timeout_minutes: 12
max_attempts: 3
command: .\src-tauri\target\debug\phoenix-test.exe --run-tests=unit -q > output-unit.txt 2>&1
shell: cmd

- name: Print windows unit test output to console
run: type output-unit.txt
shell: cmd

- name: Run tauri integration tests in windows
uses: nick-fields/retry@v2
id: windowsRunIntegration
continue-on-error: true
with:
timeout_minutes: 12
max_attempts: 3
command: .\src-tauri\target\debug\phoenix-test.exe --run-tests=integration -q > output-integration.txt 2>&1
shell: cmd

- name: Print windows integration test output to console
run: type output-integration.txt
shell: cmd

- name: Run tauri mainview tests in windows
uses: nick-fields/retry@v2
id: windowsRunMainview
continue-on-error: true
with:
timeout_minutes: 12
max_attempts: 3
command: .\src-tauri\target\debug\phoenix-test.exe --run-tests=mainview -q > output-mainview.txt 2>&1
shell: cmd

- name: Print windows mainview test output to console
run: type output-mainview.txt
shell: cmd

- name: Run tauri LegacyInteg tests in windows
uses: nick-fields/retry@v2
id: windowsRunLegacyInteg
continue-on-error: true
with:
timeout_minutes: 30
max_attempts: 3
command: .\src-tauri\target\debug\phoenix-test.exe --run-tests=LegacyInteg -q > output-LegacyInteg.txt 2>&1
shell: cmd

- name: Print windows LegacyInteg test output to console
run: type output-LegacyInteg.txt
shell: cmd

- name: Fail on test runs failed in windows
if: steps.windowsRunUnit.outcome == 'failure' || steps.windowsRunIntegration.outcome == 'failure' || steps.windowsRunMainview.outcome == 'failure' || steps.windowsRunLegacyInteg.outcome == 'failure'
run: |
echo "Windows tests failed, marking step as failed"
exit 1
shell: cmd
Loading