Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2

# Set default charset
[*.{tsx,ts,jsx,js}]
[*.{tsx,ts,jsx,js,astro,mdx,json,jsonc}]
charset = utf-8
#
# Set tab width
indent_style = space
indent_size = 2
Binary file modified .env.gpg
Binary file not shown.
13 changes: 0 additions & 13 deletions .envrc

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/comment-pr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Called by the "Comment on PR" step in playwright-e2e.yml via actions/github-script.
// Required env vars (injected by the workflow):
// JOB_STATUS – the value of ${{ job.status }}

module.exports = async ({ github, context }) => {
const { owner, repo } = context.repo;
const runId = context.runId;
const runUrl = `https://github.com/${owner}/${repo}/actions/runs/${runId}`;
const status = process.env.JOB_STATUS;
const emoji = status === 'success' ? '✅' : '❌';
const statusText = status === 'success' ? 'All tests passed' : 'Some tests failed';

const body = [
`## ${emoji} Playwright E2E — ${statusText}`,
'',
`| Detail | Link |`,
`|--------|------|`,
`| Workflow run | [View run](${runUrl}) |`,
`| HTML report | Download the **playwright-report** artifact from the run page above |`,
`| Traces & videos | Download the **playwright-results** artifact (attached when tests fail) |`,
'',
`> **How to view the HTML report locally:**`,
`> 1. Download and unzip the \`playwright-report\` artifact.`,
`> 2. Run \`bunx playwright show-report <path-to-report>\` to open it in your browser.`,
'',
`> Traces and videos are captured **on first retry** (failures only).`,
].join('\n');

// Always post a new comment so each commit push gets its own status entry
await github.rest.issues.createComment({
owner,
repo,
issue_number: context.issue.number,
body,
});
};
47 changes: 0 additions & 47 deletions .github/workflows/deploy-gh-pages.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy

on:
push:
branches:
- main

concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true

jobs:
detect-deploy:
runs-on: ubuntu-latest
outputs:
stack: ${{ steps.detect.outputs.stack }}
steps:
- id: detect
run: |
if [[ "${{ github.ref_type }}" == "tag" && "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "stack=production" >> $GITHUB_OUTPUT
else
echo "stack=dev" >> $GITHUB_OUTPUT
fi

deploy:
needs: detect-deploy
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.sha }}

- uses: actions/setup-node@v6
with:
node-version-file: ".node-version"

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Build
run: bun run w:build

- name: Configure Pulumi
uses: pulumi/actions@v6
with:
workDir: infra
stack-name: podcodar.${{ needs.detect-deploy.outputs.stack }}
env:
PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }}

- name: Pulumi up
run: |
cd infra && bun run up --yes
env:
# Cloudflare
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

# Pulumi
PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_PASSPHRASE }}
PULUMI_BACKEND_URL: "s3://podcodar-pulumi-state?endpoint=${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com"
80 changes: 80 additions & 0 deletions .github/workflows/playwright-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Playwright E2E

on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

concurrency:
group: e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e:
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write # needed for the PR comment step

steps:
- uses: actions/checkout@v6

# Astro requires Node >=22.12.0 (see .node-version / package.json engines)
- uses: actions/setup-node@v6
with:
node-version-file: ".node-version"

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

# Install only Chromium in CI – matches playwright.config.ts project list
- name: Install Playwright browsers
run: bunx playwright install --with-deps chromium

# Build the Astro site and start the preview server on port 4321
- name: Build Astro site
run: bun run build
env:
BASE_URL: "http://localhost:4321"

- name: Run Playwright E2E tests
run: bunx playwright test
env:
CI: "true"
PLAYWRIGHT_BASE_URL: "http://localhost:4321"

# Always upload artifacts so failures can be investigated
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: playwright-report/
retention-days: 14

- name: Upload test results (traces, videos, screenshots)
if: always()
uses: actions/upload-artifact@v7
with:
name: playwright-results
path: test-results/
retention-days: 14

# Comment on the PR with run status and artifact links.
# Uses github-script so it works from fork PRs without leaking secrets
# (GITHUB_TOKEN is scoped to the target repo).
- name: Comment on PR
if: always() && github.event_name == 'pull_request'
uses: actions/github-script@v9
env:
JOB_STATUS: ${{ job.status }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require('./.github/workflows/comment-pr.js')
await script({ github, context, core })
32 changes: 0 additions & 32 deletions .github/workflows/quality-gateway-pull-request.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Quality gateway

on:
pull_request:
push:
branches: [main]

concurrency:
group: quality-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6

# Astro requires Node >=22.12.0 (see package.json engines); runners default to Node 20.
- uses: actions/setup-node@v6
with:
node-version-file: ".node-version"

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Sync Astro (content types)
run: bun run typecheck

- name: Lint
run: bun run lint

- name: Format check
run: bun run format:check

- name: Astro check
run: bunx astro check

# INFO: disabled for now
# - name: Unit tests (Vitest)
# run: bun run test

- name: Build
run: bun run build
env:
BASE_URL: "http://localhost:4321"
20 changes: 0 additions & 20 deletions .github/workflows/tag-release.yml

This file was deleted.

Loading
Loading