diff --git a/.github/actions/build/action.yaml b/.github/actions/build/action.yaml new file mode 100644 index 0000000..0c90d15 --- /dev/null +++ b/.github/actions/build/action.yaml @@ -0,0 +1,18 @@ +name: "Build" +description: "Sets up the repository" +runs: + using: "composite" + steps: + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 8 + - name: Set up Node + uses: actions/setup-node@v4 + with: + registry-url: "https://registry.npmjs.org" + node-version: 22 + cache: "pnpm" + - name: Install dependencies + shell: sh + run: pnpm install diff --git a/.github/workflows/page.yaml b/.github/workflows/page.yaml new file mode 100644 index 0000000..c2c7732 --- /dev/null +++ b/.github/workflows/page.yaml @@ -0,0 +1,39 @@ +name: Deploy Pages +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: "pages" + cancel-in-progress: true + +permissions: + contents: read + pages: write + id-token: write + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build + - name: Perpare + run: pnpm run build:web + - name: Setup Pages + uses: actions/configure-pages@v4 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + # Upload entire repository + path: "./dist" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml new file mode 100644 index 0000000..d75994c --- /dev/null +++ b/.github/workflows/playwright.yaml @@ -0,0 +1,31 @@ +name: Playwright Tests +on: + push: + branches: + - main + pull_request: + branches: + - main + +concurrency: + group: "tests:e2e" + cancel-in-progress: true + +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build + - name: Install Playwright Browsers + run: pnpm exec playwright install --with-deps + - name: Run Playwright tests + run: pnpm test:e2e + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 + diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml new file mode 100644 index 0000000..a5e8d34 --- /dev/null +++ b/.github/workflows/unit-tests.yaml @@ -0,0 +1,23 @@ +name: Unit Tests +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +concurrency: + group: "tests:unit" + cancel-in-progress: true + +jobs: + # Single deploy job since we're just deploying + unit-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/build + - name: Run tests + run: pnpm test:unit