2022-02-17 05:31:54 -05:00
|
|
|
name: Browser Tests
|
|
|
|
on:
|
2022-11-30 20:30:24 -05:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
pull_request:
|
2022-02-17 05:31:54 -05:00
|
|
|
workflow_dispatch:
|
2022-02-17 06:20:29 -05:00
|
|
|
inputs:
|
|
|
|
site_url:
|
2022-11-30 20:30:24 -05:00
|
|
|
description: 'Site URL to test, or blank for local'
|
|
|
|
required: false
|
2022-02-17 06:20:29 -05:00
|
|
|
type: string
|
2022-02-17 05:31:54 -05:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
timeout-minutes: 60
|
|
|
|
runs-on: ubuntu-latest
|
2022-11-30 20:30:24 -05:00
|
|
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
2022-07-20 09:10:38 -05:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: ghost/core
|
2022-02-17 05:31:54 -05:00
|
|
|
steps:
|
2022-08-03 15:32:37 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
2022-02-17 05:31:54 -05:00
|
|
|
with:
|
2022-11-24 12:46:58 -05:00
|
|
|
node-version: '16.x'
|
2022-02-17 05:31:54 -05:00
|
|
|
cache: yarn
|
|
|
|
|
2022-11-30 20:30:24 -05:00
|
|
|
- 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
|
|
|
|
|
2022-02-17 05:31:54 -05:00
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn
|
|
|
|
|
|
|
|
- name: Install Playwright
|
|
|
|
run: npx playwright install --with-deps
|
|
|
|
|
2022-11-30 20:30:24 -05:00
|
|
|
- name: Build Admin
|
|
|
|
if: github.event.inputs.site_url == ''
|
|
|
|
working-directory: ghost/admin
|
|
|
|
run: yarn build:prod
|
|
|
|
|
2022-02-17 05:31:54 -05:00
|
|
|
- name: Run Playwright tests
|
|
|
|
run: yarn test:browser
|
|
|
|
env:
|
2022-02-17 06:25:30 -05:00
|
|
|
TEST_URL: ${{ github.event.inputs.site_url }}
|
2022-02-17 05:31:54 -05:00
|
|
|
|
2022-08-03 15:32:37 -05:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-02-17 05:31:54 -05:00
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: playwright-report
|
|
|
|
path: playwright-report/
|
|
|
|
retention-days: 30
|