Skip to content
Merged
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/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@ jobs:
- name: Check formatting
run: npx prettier src --check

test:
name: Test
runs-on: ubuntu-latest

permissions:
contents: read

steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 25

- name: Install Node.js dependencies
run: npm ci

- name: Run tests
run: npm test

build:
name: Build
runs-on: ubuntu-latest
Expand Down
42 changes: 22 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
# This workflow will run tests using node and then publish a package to GitHub Packages
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Deploy

on:
push:
branches:
- main
workflow_run:
workflows: ["Checks"]
types: [completed]
branches: [main]

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 25
- run: npm ci
- run: npm test

deploy_server:
needs: validate
name: Deploy server
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'

permissions:
contents: read

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}

- uses: actions/setup-node@v4
with:
node-version: 25

- run: npm ci
- run: npm run build-server
Expand All @@ -47,14 +42,21 @@ jobs:
pm2 start migrate

deploy_client:
needs: validate
name: Deploy client
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'

permissions:
contents: read

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}

- uses: actions/setup-node@v4
with:
node-version: 25

- run: npm ci
- run: npm run build
Expand Down
37 changes: 11 additions & 26 deletions .github/workflows/test.yml → .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
name: Test
name: E2E Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

jobs:
run-tests:
name: Run tests
run-e2e:
name: Run E2E tests
runs-on: ubuntu-latest
# container: node:20-bookworm-slim

permissions:
contents: read
Expand All @@ -31,7 +25,6 @@ jobs:
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

steps:
Expand All @@ -42,39 +35,31 @@ jobs:
- run: sudo apt-get install unzip

- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 25

# ESLint and Prettier must be in `package.json`
- name: Install Node.js dependencies
run: npm ci

- name: Running tests
run: npm test

- name: Set up Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"

# - uses: browser-actions/setup-chrome@v1
# with:
# install-chromedriver: true
# install-dependencies: true
# chrome-version: 139
- name: Build
run: npm run build

- run: npm run build
- run: npm run migrate-testdb-direct
- name: Run migrations
run: npm run migrate-testdb-direct
env:
POSTGRES_URL: "postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres"
NODE_ENV: "test"

- name: Run e2e tests
- name: Run E2E tests
run: ./src/scripts/deflake.sh "npm run e2e-test"
env:
# User, port, and db seem to be hardcoded
POSTGRES_URL: "postgres://postgres:postgres@localhost:${{ job.services.postgres.ports[5432] }}/postgres"
NODE_ENV: "test"
PORT: 3001
Loading