Skip to content

👷

👷 #316

Workflow file for this run

name: main
on: [push]
jobs:
main:
runs-on: ubuntu-latest
outputs:
published_url: ${{ steps.publish.outputs.url }}
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile
- run: bun build:app
- name: Publish
id: publish
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_PUBLISH_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: timezone-rocks
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: disclaim preview url in commit comment
uses: peter-evans/commit-comment@v3
with:
body: |
[preview](${{ steps.publish.outputs.url }})
- run: bun type
- run: bun lint
- run: npm run test
e2e:
runs-on: ubuntu-latest
needs: [main]
strategy:
fail-fast: false
matrix:
shard: ["1/1"]
browser: [chromium]
# browser: [firefox, chromium, webkit]
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ matrix.browser }}
- run: bunx playwright install ${{ matrix.browser }} --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: packages/e2e
- run: |
bunx playwright test \
--project ${{ matrix.browser }} \
--shard ${{ matrix.shard }} \
--reporter github \
--forbid-only \
--workers 1
working-directory: packages/e2e
env:
APP_URL: ${{ needs.main.outputs.published_url }}
- uses: actions/upload-artifact@v3
with:
name: playwright-screenshots-${{ matrix.browser }}
path: packages/e2e/playwright-screenshots