Skip to content

Commit b82738b

Browse files
authored
Merge pull request #24 from chipmk/chore/ci-tests
chore: ci tests
2 parents 59f9944 + a2a2e3d commit b82738b

File tree

12 files changed

+538
-60
lines changed

12 files changed

+538
-60
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Setup and Cache Playwright'
2+
description: 'Installs playwright browsers and caches them.'
3+
4+
inputs:
5+
version:
6+
description: 'The version of playwright'
7+
required: true
8+
9+
outputs:
10+
cache-hit:
11+
description: 'Whether the cache was hit or not'
12+
value: ${{ steps.playwright-cache.outputs.cache-hit }}
13+
14+
runs:
15+
using: 'composite'
16+
steps:
17+
- name: Cache playwright browsers
18+
id: playwright-cache
19+
uses: actions/cache@v4
20+
with:
21+
key: playwright-browsers-${{ runner.os }}-${{ inputs.version }}
22+
path: ~/.cache/ms-playwright
23+
24+
- name: Install playwright browsers if they don't exist
25+
shell: bash
26+
run: npx playwright install --with-deps
27+
if: steps.playwright-cache.outputs.cache-hit != 'true'
28+
29+
- name: Install playwright dependencies if binaries exist
30+
shell: bash
31+
run: npx playwright install-deps
32+
if: steps.playwright-cache.outputs.cache-hit == 'true'

.github/workflows/tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: lts/*
16+
cache: 'npm'
17+
- name: Install dependencies
18+
run: npm ci --ignore-scripts
19+
- name: Build libs
20+
run: npm run build
21+
- name: Get playwright version
22+
run: echo "PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')" >> $GITHUB_ENV
23+
- name: Setup playwright
24+
uses: ./.github/actions/setup-playwright
25+
with:
26+
version: ${{ env.PLAYWRIGHT_VERSION }}
27+
- name: Tests
28+
run: npm run test

0 commit comments

Comments
 (0)