0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/.github/workflows/browser-tests.yml
2022-12-02 17:04:04 +00:00

57 lines
1.4 KiB
YAML

name: Browser Tests
on:
push:
branches:
- 'main'
pull_request:
workflow_dispatch:
inputs:
site_url:
description: 'Site URL to test, or blank for local'
required: false
type: string
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
defaults:
run:
working-directory: ghost/core
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: yarn
- name: Install Stripe-CLI
run: |
export VERSION=1.13.5
wget "https://github.com/stripe/stripe-cli/releases/download/v$VERSION/stripe_${VERSION}_linux_x86_64.tar.gz"
tar -zxvf "stripe_${VERSION}_linux_x86_64.tar.gz"
mv stripe /usr/local/bin
stripe -v
- name: Install dependencies
run: yarn
- name: Install Playwright
run: npx playwright install --with-deps
- name: Build Admin
if: github.event.inputs.site_url == ''
working-directory: ghost/admin
run: yarn build:prod
- name: Run Playwright tests
run: yarn test:browser
env:
TEST_URL: ${{ github.event.inputs.site_url }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30