Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexErrant committed Apr 7, 2024
1 parent d257fe0 commit 15c628a
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 31 deletions.
53 changes: 52 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,60 @@ jobs:
- name: Run checks
run: ./check.sh

- name: Build
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
package_json_file: sandbox/package.json

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
working-directory: ./sandbox
run: pnpm install

- name: Install Playwright Browsers
working-directory: ./sandbox
run: pnpm exec playwright install --with-deps

- name: Build Dev
run: ./dev.sh

- name: Run Playwright dev tests
working-directory: ./sandbox
run: pnpm exec playwright test dev.spec.ts

- name: Build Prod
run: ./prod.sh

- name: Run Playwright prod tests
working-directory: ./sandbox
run: pnpm exec playwright test prod.spec.ts

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: sandbox/playwright-report/
retention-days: 30

- name: Prepublish
run: ./prepublish.sh

Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/playwright.yml

This file was deleted.

53 changes: 52 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,56 @@ jobs:
- name: Run checks
run: ./check.sh

- name: Build
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
package_json_file: sandbox/package.json

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
working-directory: ./sandbox
run: pnpm install

- name: Install Playwright Browsers
working-directory: ./sandbox
run: pnpm exec playwright install --with-deps

- name: Build Dev
run: ./dev.sh

- name: Run Playwright dev tests
working-directory: ./sandbox
run: pnpm exec playwright test dev.spec.ts

- name: Build Prod
run: ./prod.sh

- name: Run Playwright prod tests
working-directory: ./sandbox
run: pnpm exec playwright test prod.spec.ts

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: sandbox/playwright-report/
retention-days: 30
2 changes: 1 addition & 1 deletion sandbox/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default defineConfig({
/* Run your local dev server before starting the tests */
webServer: {
command: 'pnpm run start',
url: 'http://127.0.0.1:3000',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
})
2 changes: 1 addition & 1 deletion sandbox/tests/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Page } from '@playwright/test'

export async function goHome(page: Page) {
await page.goto('http://127.0.0.1:3000')
await page.goto('http://localhost:3000')
}

0 comments on commit 15c628a

Please sign in to comment.