Skip to content

Commit 5f8d4f6

Browse files
committed
ci: pr test actions where the optional pro components are not built
1 parent 00f4120 commit 5f8d4f6

File tree

2 files changed

+201
-0
lines changed

2 files changed

+201
-0
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: 'Community Edition - Desktop-mac M1 prod release full test suite run on pull request'
2+
on:
3+
pull_request:
4+
branches: [ main ]
5+
6+
concurrency:
7+
group: pr-desktop-mac-m1-prod-community-${{ github.event.pull_request.number }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
test-desktop-mac-m1-prod:
12+
runs-on: macos-15
13+
timeout-minutes: 90
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: setup node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 20
20+
- name: install Rust stable
21+
uses: dtolnay/rust-toolchain@stable
22+
with:
23+
toolchain: 1.85.1
24+
25+
- name: build phoenix dist-test
26+
run: |
27+
npm ci
28+
npm run build
29+
npm run release:prod
30+
31+
- name: Download phoenix desktop and build test runner
32+
env:
33+
GH_TOKEN: ${{ github.token }}
34+
run: |
35+
cd ..
36+
git clone https://github.com/phcode-dev/phoenix-desktop.git
37+
cd phoenix-desktop
38+
npm ci
39+
npm run releaseDistTestDebug
40+
41+
- name: Run tauri unit tests
42+
uses: nick-fields/retry@v2
43+
id: macM1RunUnit
44+
continue-on-error: true
45+
with:
46+
timeout_minutes: 12
47+
max_attempts: 3
48+
command: ../phoenix-desktop/src-tauri/target/debug/phoenix-test --run-tests=unit -q
49+
50+
- name: Run tauri integration tests
51+
uses: nick-fields/retry@v2
52+
id: macM1RunIntegration
53+
continue-on-error: true
54+
with:
55+
timeout_minutes: 12
56+
max_attempts: 3
57+
command: ../phoenix-desktop/src-tauri/target/debug/phoenix-test --run-tests=integration -q
58+
59+
- name: Run tauri mainview tests
60+
uses: nick-fields/retry@v2
61+
id: macM1RunMainview
62+
continue-on-error: true
63+
with:
64+
timeout_minutes: 12
65+
max_attempts: 3
66+
command: ../phoenix-desktop/src-tauri/target/debug/phoenix-test --run-tests=mainview -q
67+
68+
- name: Run tauri livepreview tests
69+
uses: nick-fields/retry@v2
70+
id: macM1RunLivepreview
71+
continue-on-error: true
72+
with:
73+
timeout_minutes: 12
74+
max_attempts: 3
75+
command: ../phoenix-desktop/src-tauri/target/debug/phoenix-test --run-tests=livepreview -q
76+
77+
- name: Run tauri LegacyInteg tests
78+
uses: nick-fields/retry@v2
79+
id: macM1RunLegacyInteg
80+
continue-on-error: true
81+
with:
82+
timeout_minutes: 20
83+
max_attempts: 3
84+
command: ../phoenix-desktop/src-tauri/target/debug/phoenix-test --run-tests=LegacyInteg -q
85+
86+
- name: Fail on test runs failed in Mac M1 (prod)
87+
if: steps.macM1RunUnit.outcome == 'failure' || steps.macM1RunIntegration.outcome == 'failure' || steps.macM1RunMainview.outcome == 'failure' || steps.macM1RunLivepreview.outcome == 'failure' || steps.macM1RunLegacyInteg.outcome == 'failure'
88+
run: |
89+
echo "Mac M1 (prod) tests failed, marking step as failed"
90+
echo "Failed tests:"
91+
if [ "${{ steps.macM1RunUnit.outcome }}" == "failure" ]; then
92+
echo "- Run tauri unit tests"
93+
fi
94+
if [ "${{ steps.macM1RunIntegration.outcome }}" == "failure" ]; then
95+
echo "- Run tauri integration tests"
96+
fi
97+
if [ "${{ steps.macM1RunMainview.outcome }}" == "failure" ]; then
98+
echo "- Run tauri mainview tests"
99+
fi
100+
if [ "${{ steps.macM1RunLivepreview.outcome }}" == "failure" ]; then
101+
echo "- Run tauri livepreview tests"
102+
fi
103+
if [ "${{ steps.macM1RunLegacyInteg.outcome }}" == "failure" ]; then
104+
echo "- Run tauri LegacyInteg tests"
105+
fi
106+
exit 1
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: 'Community edition - Chromium-linux run full tests suite'
2+
on:
3+
pull_request:
4+
branches: [ main ]
5+
6+
concurrency:
7+
group: pr-chromium-linux-community-${{ github.event.pull_request.number }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
playwright-chromium-linux:
12+
timeout-minutes: 90
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: setup node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 20
20+
- name: Install dependencies
21+
run: npm ci
22+
- name: Build phoenix
23+
env:
24+
PRO_REPO_URL: ${{ secrets.PRO_REPO_URL }}
25+
PRO_REPO_ACCESS_TOKEN: ${{ secrets.PRO_REPO_ACCESS_TOKEN }}
26+
run: npm run build
27+
- name: Install Playwright Browsers
28+
run: npx playwright install --with-deps
29+
30+
- name: Run Playwright unit tests in Chromium
31+
uses: nick-fields/retry@v2
32+
id: chromiumUnit
33+
continue-on-error: true
34+
with:
35+
timeout_minutes: 12
36+
max_attempts: 3
37+
command: npm run testChromium
38+
39+
- name: Run Playwright integration tests in Chromium
40+
uses: nick-fields/retry@v2
41+
id: chromiumIntegration
42+
continue-on-error: true
43+
with:
44+
timeout_minutes: 12
45+
max_attempts: 3
46+
command: npx cross-env TEST_ENV=integration npm run testChromium
47+
48+
- name: Run Playwright mainview tests in Chromium
49+
uses: nick-fields/retry@v2
50+
id: chromiumMainview
51+
continue-on-error: true
52+
with:
53+
timeout_minutes: 12
54+
max_attempts: 3
55+
command: npx cross-env TEST_ENV=mainview npm run testChromium
56+
57+
- name: Run Playwright livepreview tests in Chromium
58+
uses: nick-fields/retry@v2
59+
id: chromiumLivepreview
60+
continue-on-error: true
61+
with:
62+
timeout_minutes: 15
63+
max_attempts: 3
64+
command: npx cross-env TEST_ENV=livepreview npm run testChromium
65+
66+
- name: Run Playwright LegacyInteg tests in Chromium
67+
uses: nick-fields/retry@v2
68+
id: chromiumLegacyInteg
69+
continue-on-error: true
70+
with:
71+
timeout_minutes: 20
72+
max_attempts: 3
73+
command: npx cross-env TEST_ENV=LegacyInteg npm run testChromium
74+
75+
- name: Fail on test runs failed in Chromium Linux
76+
if: steps.chromiumUnit.outcome == 'failure' || steps.chromiumIntegration.outcome == 'failure' || steps.chromiumMainview.outcome == 'failure' || steps.chromiumLivepreview.outcome == 'failure' || steps.chromiumLegacyInteg.outcome == 'failure'
77+
run: |
78+
echo "Chromium Linux Playwright tests failed, marking step as failed"
79+
echo "Failed tests:"
80+
if [ "${{ steps.chromiumUnit.outcome }}" == "failure" ]; then
81+
echo "- Run Playwright unit tests in Chromium"
82+
fi
83+
if [ "${{ steps.chromiumIntegration.outcome }}" == "failure" ]; then
84+
echo "- Run Playwright integration tests in Chromium"
85+
fi
86+
if [ "${{ steps.chromiumMainview.outcome }}" == "failure" ]; then
87+
echo "- Run Playwright mainview tests in Chromium"
88+
fi
89+
if [ "${{ steps.chromiumLivepreview.outcome }}" == "failure" ]; then
90+
echo "- Run Playwright livepreview tests in Chromium"
91+
fi
92+
if [ "${{ steps.chromiumLegacyInteg.outcome }}" == "failure" ]; then
93+
echo "- Run Playwright LegacyInteg tests in Chromium"
94+
fi
95+
exit 1

0 commit comments

Comments
 (0)