feat(svelte-ui): copy font files from remix-ui
#943
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- main | |
- prod | |
pull_request: | |
merge_group: | |
defaults: | |
run: | |
working-directory: ./remix-ui | |
jobs: | |
lint: | |
name: ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/[email protected] | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Get package manager version | |
id: get-pnpm-version | |
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ steps.get-pnpm-version.outputs.version }} | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: remix-ui/package.json | |
cache-dependency-path: remix-ui/pnpm-lock.yaml | |
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 --generator js | |
- 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@v4 | |
- name: Get package manager version | |
id: get-pnpm-version | |
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ steps.get-pnpm-version.outputs.version }} | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: remix-ui/package.json | |
cache-dependency-path: remix-ui/pnpm-lock.yaml | |
cache: pnpm | |
- name: Download deps | |
run: pnpm install --frozen-lockfile | |
- name: Generate prisma | |
run: pnpm prisma generate --generator js | |
- 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@v4 | |
- name: Get package manager version | |
id: get-pnpm-version | |
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ steps.get-pnpm-version.outputs.version }} | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: remix-ui/package.json | |
cache-dependency-path: remix-ui/pnpm-lock.yaml | |
cache: pnpm | |
- name: Download deps | |
run: pnpm install --frozen-lockfile | |
- name: Run vitest | |
run: pnpm test -- --coverage | |
cypress: | |
name: Cypress | |
runs-on: ubuntu-latest | |
env: | |
PORT: '8811' | |
services: | |
localhost: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/[email protected] | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Get package manager version | |
id: get-pnpm-version | |
run: echo "version=$(cat package.json | jq -r .packageManager | sed s/pnpm@//)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ steps.get-pnpm-version.outputs.version }} | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: remix-ui/package.json | |
cache-dependency-path: remix-ui/pnpm-lock.yaml | |
cache: pnpm | |
- name: Cache cypress binary | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/Cypress | |
key: cypress-${{ runner.os }}-${{ hashFiles('remix-ui/pnpm-lock.yaml') }} | |
- name: Download deps | |
run: pnpm install --frozen-lockfile | |
- name: Download cypress binary | |
run: pnpm cypress install | |
- name: Copy test env vars | |
run: cp .env.example .env | |
- name: Setup database | |
run: pnpm prisma migrate reset --force --skip-seed --skip-generate | |
- name: Build | |
run: pnpm build | |
- name: Start frontend | |
id: startfrontend | |
run: | | |
pnpm start:mocks > frontend.log 2>&1 & | |
echo $! > frontend_pid.txt | |
env: | |
SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | |
SUPABASE_ANON_KEY: ${{ secrets.SUPABASE_ANON_KEY }} | |
- name: Wait for frontend | |
run: pnpm wait-on --timeout 60000 http://localhost:${{ env.PORT }} | |
- name: Run cypress tests | |
run: pnpm cypress run --record --tag ${{ github.event_name }} --spec cypress/e2e/smoke.cy.ts | |
env: | |
# testing keys (e.g. cypress) and other environment variables. | |
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 }} | |
- name: Kill frontend | |
if: ${{ always() && steps.startfrontend.outcome == 'success' }} | |
run: | | |
frontend_pid=$(cat frontend_pid.txt) | |
kill $frontend_pid | |
- name: Display frontend logs | |
if: always() | |
run: | | |
cat frontend.log | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/[email protected] | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- 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: ./remix-ui | |
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 |