Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: bundler
directory: /api
schedule:
interval: weekly
groups:
ruby-security-and-maintenance:
patterns: ["*"]

- package-ecosystem: npm
directory: /web
schedule:
interval: weekly
groups:
frontend-security-and-maintenance:
patterns: ["*"]

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
89 changes: 89 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: CI

on:
pull_request:
push:
branches: [main]

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
backend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: api
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: hafa_code_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432/hafa_code_test
RUBOCOP_CACHE_ROOT: tmp/rubocop

steps:
- uses: actions/checkout@v6

- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3.7"
bundler-cache: true
working-directory: api

- name: Prepare database
run: bin/rails db:prepare

- name: Test
run: bin/rails test

- name: Ruby style
run: bin/rubocop --format github

- name: Static security scan
run: bin/brakeman --no-pager

- name: Dependency security audit
run: bundle exec bundler-audit check --update

frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: web

steps:
- uses: actions/checkout@v6

- uses: actions/setup-node@v6
with:
node-version-file: .node-version
cache: npm
cache-dependency-path: web/package-lock.json

- name: Install dependencies
run: npm ci

- name: Test
run: npm test

- name: Lint
run: npm run lint

- name: Build
run: npm run build

- name: Dependency security audit
run: npm audit --audit-level=high
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.22.3
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ hafa-code/
- [Security model](docs/SECURITY.md)
- [Multi-file workspace plan](docs/MULTI_FILE_WORKSPACE.md)
- [Classroom, orgs, sharing, accessibility, and runner plan](docs/CLASSROOM_ORGS_AND_SHARING_PLAN.md)
- [FDMS classroom launch readiness and action plan](docs/FDMS_CLASSROOM_LAUNCH_PLAN.md)

## Security Model

Expand Down
6 changes: 6 additions & 0 deletions api/.env.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
DATABASE_URL=postgres://localhost/hafa_code_development
FRONTEND_URL=http://localhost:5173
ALLOWED_ORIGINS=http://localhost:5173
SOLID_QUEUE_IN_PUMA=true
JOB_CONCURRENCY=1

CLERK_ISSUER=https://example.clerk.accounts.dev
CLERK_JWKS_URL=https://example.clerk.accounts.dev/.well-known/jwks.json
CLERK_AUDIENCE=
CLERK_SECRET_KEY=sk_test_replace_me
OWNER_ADMIN_EMAILS=
ALLOW_OPEN_SIGNUPS=true
ALLOWED_MEMBER_EMAIL_DOMAINS=
ALLOW_ORGANIZATION_EXTERNAL_SHARING=false
RESEND_API_KEY=
RESEND_FROM_EMAIL=
90 changes: 0 additions & 90 deletions api/.github/workflows/ci.yml

This file was deleted.

1 change: 1 addition & 0 deletions api/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ gem "rack-cors"
gem "dotenv-rails"
gem "httparty"
gem "resend", "~> 1.0"
gem "solid_queue"
Loading
Loading