mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
playwright github ci action
This commit is contained in:
parent
db7cbd8982
commit
8f46b276c0
3 changed files with 57 additions and 21 deletions
39
.github/workflows/main.yml
vendored
39
.github/workflows/main.yml
vendored
|
@ -13,6 +13,7 @@ permissions:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Scramjet
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
@ -59,11 +60,45 @@ jobs:
|
|||
path: |
|
||||
dist/*.js
|
||||
dist/*.js.map
|
||||
tests:
|
||||
name: Run Scramjet Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install
|
||||
|
||||
- name: Get artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: scramjet
|
||||
path: dist
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install --with-deps
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm test
|
||||
|
||||
upload:
|
||||
name: Upload Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
needs: [build, tests]
|
||||
permissions: write-all
|
||||
if: github.ref == 'refs/heads/main'
|
||||
|
||||
|
@ -94,7 +129,7 @@ jobs:
|
|||
pages:
|
||||
name: Upload to Github Pages
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
needs: [build, tests]
|
||||
if: github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
|
|
@ -8,7 +8,7 @@ export default defineConfig({
|
|||
fullyParallel: true,
|
||||
forbidOnly: !!process.env.CI,
|
||||
retries: 2,
|
||||
reporter: "html",
|
||||
reporter: process.env.CI ? "github" : "html",
|
||||
timeout: 20000,
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
use: {
|
||||
|
|
|
@ -85,7 +85,7 @@ fastify.listen({
|
|||
host: "0.0.0.0",
|
||||
});
|
||||
console.log(`Listening on port ${PORT}`);
|
||||
|
||||
if (!process.env.CI) {
|
||||
try {
|
||||
writeFileSync(
|
||||
".git/hooks/pre-commit",
|
||||
|
@ -106,3 +106,4 @@ watch.stdout.on("data", (data) => {
|
|||
watch.stderr.on("data", (data) => {
|
||||
console.log(`${data}`);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue