-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (57 loc) · 1.77 KB
/
playwright.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
jobs:
build-rust-binary:
runs-on: macos-latest
env:
# Ensure the correct target architecture is set
CARGO_TARGET_DIR: target
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v4
# Set up Rust with the appropriate toolchain
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
# Cache the Cargo registry and build directory to speed up builds
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-build-
# Install dependencies
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install npm dependencies
run: yarn
# Build the Rust binary with napi
- name: Build Rust Binary with napi
run: npx napi build --cargo-name bslive --platform aarch64-apple-darwin
- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30