Skip to content

Commit

Permalink
Merge branch 'main' into benchmark-instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
katconnors committed Jan 28, 2025
2 parents f289283 + 351e297 commit 55ef1e2
Show file tree
Hide file tree
Showing 63 changed files with 33,819 additions and 27,011 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ EMAIL_AUTH_PASS=
EMAIL_FROM=[email protected]
EMAIL_HOST=localhost
EMAIL_PORT=1025

BASE_URL=http://localhost:3000
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Authenticate with Google Cloud
id: auth
Expand All @@ -23,16 +23,16 @@ jobs:
access_token_lifetime: 300s

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v1
- uses: docker/login-action@v3
with:
registry: "${{ secrets.GCS_REGION }}-docker.pkg.dev"
username: "oauth2accesstoken"
password: ${{ steps.auth.outputs.access_token }}

- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
push: true
tags: "${{ secrets.GCS_REGION }}-docker.pkg.dev/${{ secrets.GCS_PROJECT_ID }}/${{ secrets.GCS_ARTIFACT_REPO_NAME }}/compass:${{ github.sha }}"
Expand All @@ -50,7 +50,7 @@ jobs:
run:
working-directory: ./terraform/gcs
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Authenticate with Google Cloud
id: auth
Expand All @@ -61,7 +61,7 @@ jobs:
service_account: ${{ secrets.GCS_SERVICE_ACCOUNT_EMAIL }}
access_token_lifetime: 300s

- uses: hashicorp/setup-terraform@v2
- uses: hashicorp/setup-terraform@v3

- run: terraform init -backend-config=../backend.hcl

Expand Down
43 changes: 32 additions & 11 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: "npm"
- name: Install dependencies & generate css types
run: npm ci
Expand All @@ -22,14 +22,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: "npm"
- name: Install dependencies
run: npm i --ci
run: npm ci
- name: Run format:check
run: |
npm run format:version
Expand All @@ -42,15 +42,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: "npm"
- name: Install dependencies
run: npm i --ci
run: npm ci
- name: Pre-pull Postgres image
run: docker pull postgres:15
- name: Run tests
run: npm run test

storybook-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Build Storybook
run: npm run build:storybook --quiet
- name: Serve Storybook and run tests
run: |
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \
"npx http-server storybook-static --port 6006 --silent" \
"npx wait-on tcp:127.0.0.1:6006 && npm run test-storybook"
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
7 changes: 7 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { StorybookConfig } from "@storybook/nextjs";
const config: StorybookConfig = {
staticDirs: ["../public"],
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],

addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
Expand All @@ -11,10 +12,16 @@ const config: StorybookConfig = {
"@tomfreudenberg/next-auth-mock/storybook",
"@chromatic-com/storybook",
],

framework: {
name: "@storybook/nextjs",
options: {},
},

docs: {},

typescript: {
reactDocgen: "react-docgen-typescript",
},
};
export default config;
4 changes: 3 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import "../src/styles/globals.css";

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},

decorators: [
(Story) => (
<FontProvider>
Expand All @@ -27,6 +27,8 @@ const preview: Preview = {
</FontProvider>
),
],

tags: ["autodocs"],
};

export default preview;
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


# Start with the latest Node.js LTS release
FROM --platform=linux/amd64 node:18-bullseye-slim
FROM --platform=linux/amd64 node:22-bullseye-slim

# Set env variables
ENV NODE_ENV production
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ The database container does not need to be started to run tests, but Docker Desk

Run all tests with `npm run test`. An individual test file can be run with `npm run test <path/to/file>` (e.x. `npm run test src/routes/students.test.ts`).

To run tests in watch mode, use `npm run test:watch`. This will run tests whenever a file is changed, but will not take database schema changes into account.

### Database

#### Creating migrations
Expand Down
10 changes: 7 additions & 3 deletions ava.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
module.exports = {
const avaConfig = {
timeout: "90s",
files: ["src/**/*.test.ts"],
extensions: ["ts"],
require: ["@esbuild-kit/cjs-loader"],
ignoredByWatcher: ["**/.next/**"],
require: ["tsx"],
nodeArguments: ["--no-warnings"],
watchMode: {
ignoreChanges: ["**/.next/**"],
},
};
export default avaConfig;
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ const nextConfig = {
},
};

module.exports = nextConfig;
export default nextConfig;
Loading

0 comments on commit 55ef1e2

Please sign in to comment.