Skip to content

Commit 25aa5df

Browse files
author
Mohammod Al Amin Ashik
committed
test
1 parent 861f784 commit 25aa5df

5 files changed

Lines changed: 142 additions & 3 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Run Tauri E2E tests when someone comments /e2e-tauri on a PR.
2+
# Usage: Add a comment "/e2e-tauri" on any PR to trigger desktop E2E tests.
3+
4+
name: E2E Tauri (Comment Trigger)
5+
6+
on:
7+
issue_comment:
8+
types: [created]
9+
10+
jobs:
11+
e2e-tauri:
12+
# Only run when comment on a PR contains /e2e-tauri
13+
if: |
14+
github.event.issue.pull_request != null &&
15+
contains(github.event.comment.body, '/e2e-tauri')
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- os: ubuntu-latest
21+
- os: windows-latest
22+
23+
runs-on: ${{ matrix.os }}
24+
permissions:
25+
contents: read
26+
pull-requests: read
27+
steps:
28+
- name: Get PR head ref
29+
id: pr
30+
uses: actions/github-script@v7
31+
with:
32+
script: |
33+
const pr = await github.rest.pulls.get({
34+
owner: context.repo.owner,
35+
repo: context.repo.repo,
36+
pull_number: context.issue.number,
37+
});
38+
core.setOutput('ref', pr.data.head.ref);
39+
core.setOutput('sha', pr.data.head.sha);
40+
core.setOutput('pr_number', context.issue.number);
41+
42+
- uses: actions/checkout@v4
43+
with:
44+
ref: ${{ steps.pr.outputs.sha }}
45+
46+
- uses: dtolnay/rust-toolchain@stable
47+
- uses: Swatinem/rust-cache@v2
48+
with:
49+
key: ${{ matrix.os }}-e2e-comment
50+
51+
- uses: pnpm/action-setup@v4
52+
- uses: actions/setup-node@v4
53+
with:
54+
node-version: 20
55+
cache: 'pnpm'
56+
57+
- name: Install Linux deps
58+
if: matrix.os == 'ubuntu-latest'
59+
run: |
60+
sudo apt-get update
61+
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev webkit2gtk-driver xvfb
62+
63+
- name: Cache tauri-driver
64+
uses: actions/cache@v4
65+
id: tauri-driver-cache
66+
with:
67+
path: ~/.cargo/bin/tauri-driver*
68+
key: tauri-driver-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
69+
70+
- name: Install tauri-driver
71+
if: steps.tauri-driver-cache.outputs.cache-hit != 'true'
72+
run: cargo install tauri-driver --locked
73+
74+
- run: pnpm install --frozen-lockfile
75+
76+
- name: Build app
77+
run: pnpm build
78+
env:
79+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
80+
81+
- name: Run Tauri E2E tests (Linux)
82+
if: matrix.os == 'ubuntu-latest'
83+
run: xvfb-run --auto-servernum pnpm test:e2e
84+
85+
- name: Run Tauri E2E tests (Windows)
86+
if: matrix.os == 'windows-latest'
87+
run: pnpm test:e2e

packages/ui/eslint.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import reactHooks from 'eslint-plugin-react-hooks';
4+
import reactRefresh from 'eslint-plugin-react-refresh';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
23+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
24+
'@typescript-eslint/no-explicit-any': 'warn',
25+
},
26+
}
27+
);

packages/ui/package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,24 @@
1616
"scripts": {
1717
"build": "tsc",
1818
"dev": "tsc --watch",
19-
"lint": "eslint src --ext ts,tsx",
19+
"lint": "eslint src",
20+
"lint:fix": "eslint src --fix",
2021
"test": "echo \"No tests yet\""
2122
},
2223
"peerDependencies": {
2324
"react": "^19.0.0",
2425
"react-dom": "^19.0.0"
2526
},
2627
"devDependencies": {
28+
"@eslint/js": "^9.39.2",
2729
"@types/react": "^19.0.0",
2830
"@types/react-dom": "^19.0.0",
29-
"typescript": "^5.3.0"
31+
"eslint": "^9.39.2",
32+
"eslint-plugin-react-hooks": "^7.0.1",
33+
"eslint-plugin-react-refresh": "^0.4.24",
34+
"globals": "^16.5.0",
35+
"typescript": "^5.3.0",
36+
"typescript-eslint": "^8.49.0"
3037
},
3138
"dependencies": {
3239
"clsx": "^2.1.1",

packages/ui/src/components/common/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { HTMLAttributes, forwardRef } from 'react';
22
import { cn } from '../../lib/cn';
33

4-
interface CardProps extends HTMLAttributes<HTMLDivElement> {}
4+
type CardProps = HTMLAttributes<HTMLDivElement>;
55

66
export const Card = forwardRef<HTMLDivElement, CardProps>(({ className, ...props }, ref) => {
77
return (

pnpm-lock.yaml

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)