mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Fixed browser-based tests running in CI
refs: https://github.com/TryGhost/Toolbox/issues/481 * Correctly setup environment variable to run both local & staging browser-based tests * Use non-production Ghost Admin build, since production builds require HTTPS to use Stripe Connect
This commit is contained in:
parent
5e973688bf
commit
d3716007bf
18
.github/workflows/browser-tests.yml
vendored
18
.github/workflows/browser-tests.yml
vendored
@ -27,12 +27,17 @@ jobs:
|
|||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/'))
|
||||||
environment: ${{ github.event.inputs.environment || "browser-tests-local" }}
|
environment: ${{ github.event.inputs.environment || 'browser-tests-local' }}
|
||||||
|
env:
|
||||||
|
ENVIRONMENT: ${{ github.event.inputs.environment || 'browser-tests-local' }}
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: ghost/core
|
working-directory: ghost/core
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
submodules: true
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16.x'
|
node-version: '16.x'
|
||||||
@ -49,16 +54,19 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn
|
run: yarn
|
||||||
|
|
||||||
|
- name: Run migrations
|
||||||
|
run: yarn setup
|
||||||
|
|
||||||
- name: Install Playwright
|
- name: Install Playwright
|
||||||
run: npx playwright install --with-deps
|
run: npx playwright install --with-deps
|
||||||
|
|
||||||
- name: Build Admin
|
- name: Build Admin
|
||||||
if: github.event.inputs.environment == 'browser-tests-local'
|
if: env.ENVIRONMENT == 'browser-tests-local'
|
||||||
working-directory: ghost/admin
|
working-directory: ghost/admin
|
||||||
run: yarn build:prod
|
run: yarn build --silent
|
||||||
|
|
||||||
- name: Run Playwright tests on a remote site
|
- name: Run Playwright tests on a remote site
|
||||||
if: github.event.inputs.environment == 'browser-tests-staging'
|
if: env.ENVIRONMENT == 'browser-tests-staging'
|
||||||
run: yarn test:browser
|
run: yarn test:browser
|
||||||
env:
|
env:
|
||||||
TEST_URL: ${{ github.event.inputs.site_url || secrets.TEST_URL }}
|
TEST_URL: ${{ github.event.inputs.site_url || secrets.TEST_URL }}
|
||||||
@ -66,7 +74,7 @@ jobs:
|
|||||||
TEST_OWNER_PASSWORD: ${{ github.event.inputs.owner_password || secrets.TEST_OWNER_PASSWORD }}
|
TEST_OWNER_PASSWORD: ${{ github.event.inputs.owner_password || secrets.TEST_OWNER_PASSWORD }}
|
||||||
|
|
||||||
- name: Run Playwright tests locally
|
- name: Run Playwright tests locally
|
||||||
if: github.event.inputs.environment == 'browser-tests-local'
|
if: env.ENVIRONMENT == 'browser-tests-local'
|
||||||
run: yarn test:browser
|
run: yarn test:browser
|
||||||
env:
|
env:
|
||||||
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }}
|
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }}
|
||||||
|
@ -30,7 +30,7 @@ if (!process.env.TEST_URL) {
|
|||||||
NODE_ENV: 'development',
|
NODE_ENV: 'development',
|
||||||
WEBHOOK_SECRET: getWebhookSecret()
|
WEBHOOK_SECRET: getWebhookSecret()
|
||||||
},
|
},
|
||||||
reuseExistingServer: !process.env.CI,
|
reuseExistingServer: false,
|
||||||
url: 'http://localhost:2368'
|
url: 'http://localhost:2368'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user