Skip to content

fix(app/infinite-list): add initialRect for SSR #836

fix(app/infinite-list): add initialRect for SSR

fix(app/infinite-list): add initialRect for SSR #836

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
- prod
pull_request:
merge_group:
jobs:
lint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: package.json
cache: pnpm
- name: Download deps
run: pnpm install --frozen-lockfile
# Linting fails in CI because `~/styles/tailwind.css` does not exist and
# thus my `import/order` rule errors (because it doesn't mark that as a
# local import as the file doesn't exist). This addresses that.
- name: Stub imported css
run: mkdir app/styles && touch app/styles/tailwind.css
- name: Generate prisma
run: pnpm prisma generate
- name: Lint
run: pnpm lint
typecheck:
name: TypeScript
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: package.json
cache: pnpm
- name: Download deps
run: pnpm install --frozen-lockfile
- name: Generate prisma
run: pnpm prisma generate
- name: Type check
run: pnpm typecheck
vitest:
name: Vitest
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: package.json
cache: pnpm
- name: Download deps
run: pnpm install --frozen-lockfile
- name: Run vitest
run: pnpm test -- --coverage
cypress:
name: Cypress
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version-file: package.json
cache: pnpm
- name: Download deps
run: pnpm install --frozen-lockfile
- name: Copy test env vars
run: cp .env.example .env
- name: Docker compose
# the sleep is just there to give time for postgres to get started
run: docker-compose --env-file .env up -d && sleep 3
- name: Setup database
run: pnpm prisma migrate reset --force --skip-seed
- name: Build
run: pnpm build
- name: Cypress run
uses: cypress-io/github-action@v5
with:
start: pnpm start:mocks
wait-on: 'http://localhost:8811'
record: true
tag: ${{ github.event_name }}
# right now, we can't easily reset state between tests and thus we're
# only going to run a single smoke test (hitting k8s back-end) in CI.
spec: cypress/e2e/smoke.cy.ts
env:
PORT: '8811'
SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# override the github commit message for better Cypress Cloud mesages.
# @see https://github.com/cypress-io/github-action/issues/124#issuecomment-653180260
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title }}
# re-enable the Cypress GitHub PR comment bot
# @see https://docs.cypress.io/guides/continuous-integration/github-actions#Pull-requests-commit-message-is-merge-SHA-into-SHA
COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha }}
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
- name: Checkout repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
flavor: |
latest=auto
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker build
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
# only upload main branch (on pushes) to GHCR. otherwise, just check
# to ensure that the docker build completes without error.
push: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/prod') && github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max