adding a test #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
playwright-tests: | |
needs: build-rust-binary | |
timeout-minutes: 10 | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: yarn | |
- name: Install Playwright Browsers | |
run: npx playwright install --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 |