Skip to content

Commit

Permalink
Merge branch 'dev' into vercel-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
N2D4 authored Dec 27, 2024
2 parents 2ed6081 + 640026c commit 2b9ce9a
Show file tree
Hide file tree
Showing 205 changed files with 82,651 additions and 1,585 deletions.
113 changes: 0 additions & 113 deletions .github/workflows/check-codegen.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/check-prisma-migrations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Ensure Prisma migrations are in sync with the schema

on:
push:
branches:
- dev
- main
pull_request:
branches:
- dev
- main

jobs:
check_prisma_migrations:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

steps:
- uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.1.2

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

- name: Start Postgres shadow DB
run: docker run -d --name postgres-prisma-diff-shadow -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=PLACEHOLDER-PASSWORD--dfaBC1hm1v -e POSTGRES_DB=postgres -p 5432:5432 postgres:latest

- name: Check for differences in Prisma schema and migrations
run: pnpm run prisma migrate diff --from-migrations ./prisma/migrations --to-schema-datamodel ./prisma/schema.prisma --shadow-database-url postgres://postgres:PLACEHOLDER-PASSWORD--dfaBC1hm1v@localhost:5432/postgres --exit-code
3 changes: 1 addition & 2 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ on:
branches:
- main
- dev
- docker-build
tags:
- "*.*.*"
pull_request:

jobs:
build-server:
name: Docker Build and Push Server
runs-on: ubuntu-latest
runs-on: ubicloud-standard-8
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/docker-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Docker Test

on:
push:
branches:
- dev
- main
pull_request:
branches:
- dev
- main

jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup postgres
run: |
docker run -d --name db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=stackframe -p 5432:5432 postgres:latest
sleep 5
docker logs db
- name: Build Docker image
run: docker build -f docker/server/Dockerfile -t server .

- name: Run Docker container and check logs
run: |
docker run --add-host=host.docker.internal:host-gateway --env-file docker/server/.env.example -p 8101:8101 -p 8102:8102 -d --name stackframe-server server
sleep 10
docker logs stackframe-server
- name: Check server health
run: |
echo "Attempting to connect to server..."
curl -v http://localhost:8101
response_code=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8101)
echo "Response code: $response_code"
if [ $response_code -ne 200 ]; then
echo "Server health check failed with status code: $response_code"
exit 1
fi
7 changes: 5 additions & 2 deletions .github/workflows/e2e-api-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubicloud-standard-16
env:
NODE_ENV: test
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes

strategy:
matrix:
node-version: [20.x, 22.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -125,6 +125,9 @@ jobs:
- name: Run tests again, to make sure they are stable (attempt 3)
run: pnpm test

- name: Verify data integrity
run: pnpm run verify-data-integrity

- name: Print Docker Compose logs
if: always()
run: docker compose -f dependencies.compose.yaml logs
17 changes: 16 additions & 1 deletion .github/workflows/lint-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:

jobs:
lint_and_build:
runs-on: ubuntu-latest
runs-on: ubicloud-standard-8

strategy:
matrix:
Expand Down Expand Up @@ -72,6 +72,21 @@ jobs:

- name: Typecheck
run: pnpm typecheck

- name: Store Quetzal API key in packages/stack/.env.local to prepare for code gen
run: echo "QUETZAL_API_KEY=${{ secrets.QUETZAL_API_KEY }}" > packages/stack/.env.local

- name: Run code gen # so we can check for uncommitted changes afterwards; `build` doesn't regenerate some committed files, eg. Quetzal
run: pnpm codegen

- name: Check for uncommitted changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Error: There are uncommitted changes after build/lint/typecheck."
echo "Please commit all changes before pushing."
git status
exit 1
fi
- name: Check for uncommitted changes
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: pull_request

jobs:
run:
runs-on: ubuntu-latest
runs-on: ubicloud-standard-8

permissions: write-all

Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,7 @@ on:

jobs:
run:
runs-on: ubuntu-latest
env:
NEXT_PUBLIC_STACK_API_URL: http://localhost:8102
NEXT_PUBLIC_STACK_PROJECT_ID: internal
NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY: internal-project-publishable-client-key
STACK_SECRET_SERVER_KEY: internal-project-secret-server-key
STACK_SERVER_SECRET: 23-wuNpik0gIW4mruTz25rbIvhuuvZFrLOLtL7J4tyo

STACK_EMAIL_HOST: 127.0.0.1
STACK_EMAIL_PORT: 2500
STACK_EMAIL_USERNAME: test
STACK_EMAIL_PASSWORD: none
STACK_EMAIL_SENDER: [email protected]

STACK_DATABASE_CONNECTION_STRING: postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/stackframe
STACK_DIRECT_DATABASE_CONNECTION_STRING: postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:5432/stackframe
runs-on: ubicloud-standard-8

permissions: write-all

Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

"esbenp.prettier-vscode"
]
}
19 changes: 18 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,27 @@
"typescript.tsdk": "node_modules/typescript/lib",
"editor.tabSize": 2,
"cSpell.words": [
"backlinks",
"Cdfc",
"cjsx",
"clsx",
"cmdk",
"codegen",
"Crudl",
"ctsx",
"datapoints",
"deindent",
"deindented",
"EAUTH",
"EDNS",
"EMESSAGE",
"Falsey",
"frontends",
"geoip",
"hookform",
"hostable",
"INBUCKET",
"ipcountry",
"Jwks",
"JWTs",
"katex",
Expand Down Expand Up @@ -67,6 +74,8 @@
"typecheck",
"typehack",
"Uncapitalize",
"unindexed",
"unsubscribers",
"upsert",
"webapi",
"webauthn",
Expand All @@ -80,5 +89,13 @@
},
"terminal.integrated.wordSeparators": " (){}',\"`─‘’“”|",
"editor.formatOnSave": false,
"prettier.enable": false
"prettier.enable": false,
"debug.javascript.autoAttachSmartPattern": [
"${workspaceFolder}/**",
"!**/node_modules/**",
"**/$KNOWN_TOOLS$/**",
"**/start-server.js",
"**/turbo/**"
],
"files.insertFinalNewline": true
}
Loading

0 comments on commit 2b9ce9a

Please sign in to comment.