Skip to content

Commit

Permalink
ci: run playwright on github actions
Browse files Browse the repository at this point in the history
.

.

.
  • Loading branch information
kantord committed Jul 28, 2024
1 parent 57ec4cb commit 65979bc
Show file tree
Hide file tree
Showing 27 changed files with 2,795 additions and 684 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ __pycache__
.pdm-python
.next
node_modules
apps/librelingo-web/out/
playwright-report
test-results
neovide_backtraces.log
courses/
!courses/test-1
!courses/test-2
**/*.tsbuildinfo
/apps/librelingo-web/out/
/apps/librelingo-web/src/courses/*
/courses/*
!/apps/librelingo-web/src/courses/test-*
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { listAvailableCourses } from "@/data/course"

export async function generateStaticParams() {
const courses = await listAvailableCourses()

return courses.map((course) => ({
sourceLanguageCode: course.uiLanguage,
targetLanguageCode: course.languageCode,
}))
}

export default function CourseHomePage() {
return <h1>Hello world</h1>
}
5 changes: 2 additions & 3 deletions apps/librelingo-web/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from 'next'
import CourseCard from './CourseCard';
import { Course, listAllCourses } from '@/data/course';
import { Course, listAvailableCourses } from '@/data/course';



Expand All @@ -10,8 +10,7 @@ export const metadata: Metadata = {
}

export default async function Home() {
const courseData = await listAllCourses()
console.log(courseData)
const courseData = await listAvailableCourses()

return (
<>
Expand Down
30 changes: 14 additions & 16 deletions apps/librelingo-web/src/courses/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
[
{
"url": "",
"repositoryURL": "",
"paths": {
"yamlFolder": "test-1",
"jsonFolder": "test-1"
},
"deploy": true,
"inProduction": false,
"name": "test-1",
"source": "English",
"target": "Test1",
"description": "Test1 for English speakers"
},
{
"url": "https://github.com/LibreLingo/LibreLingo-ES-from-EN/archive/refs/heads/main.zip",
"repositoryURL": "https://github.com/LibreLingo/LibreLingo-ES-from-EN",
Expand All @@ -7,7 +21,6 @@
"jsonFolder": "spanish-from-english"
},
"deploy": true,
"devtoolsEnabled": true,
"inProduction": true,
"name": "spanish-from-english",
"source": "English",
Expand All @@ -22,7 +35,6 @@
"jsonFolder": "ladino-from-english"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "ladino-from-english",
"source": "English",
Expand All @@ -37,7 +49,6 @@
"jsonFolder": "ladino-from-hebrew"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "ladino-from-hebrew",
"source": "Hebrew",
Expand All @@ -52,7 +63,6 @@
"jsonFolder": "ladino-from-spanish"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "ladino-from-spanish",
"source": "Spanish",
Expand All @@ -67,7 +77,6 @@
"jsonFolder": "hungarian-from-spanish"
},
"deploy": false,
"devtoolsEnabled": true,
"inProduction": false,
"name": "hungarian-from-spanish",
"source": "Spanish",
Expand All @@ -82,7 +91,6 @@
"jsonFolder": "german-from-english"
},
"deploy": true,
"devtoolsEnabled": true,
"inProduction": true,
"name": "german-from-english",
"source": "English",
Expand All @@ -97,7 +105,6 @@
"jsonFolder": "basque-from-english"
},
"deploy": false,
"devtoolsEnabled": true,
"inProduction": false,
"name": "basque-from-english",
"source": "English",
Expand All @@ -112,7 +119,6 @@
"jsonFolder": "bangla-from-english"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "bangla-from-english",
"source": "English",
Expand All @@ -127,7 +133,6 @@
"jsonFolder": "french-from-english"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "french-from-english",
"source": "English",
Expand All @@ -142,7 +147,6 @@
"jsonFolder": "parsig-from-english"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "parsig-from-english",
"source": "English",
Expand All @@ -157,7 +161,6 @@
"jsonFolder": "houma-from-english"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "houma-from-english",
"source": "English",
Expand All @@ -172,7 +175,6 @@
"jsonFolder": "brazilian-portuguese-from-english"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "brazilian-portuguese-from-english",
"source": "English",
Expand All @@ -187,7 +189,6 @@
"jsonFolder": "neolatin-from-english"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "neolatin-from-english",
"source": "English",
Expand All @@ -202,7 +203,6 @@
"jsonFolder": "occitan-auvergnat-from-french"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "occitan-auvergnat-from-french",
"source": "French",
Expand All @@ -217,7 +217,6 @@
"jsonFolder": "kabyle-from-french"
},
"deploy": false,
"devtoolsEnabled": false,
"inProduction": false,
"name": "kabyle-from-french",
"source": "French",
Expand All @@ -232,7 +231,6 @@
"jsonFolder": "dutch-from-english"
},
"deploy": true,
"devtoolsEnabled": false,
"inProduction": true,
"name": "dutch-from-english",
"source": "English",
Expand Down
Loading

0 comments on commit 65979bc

Please sign in to comment.