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
6 changes: 3 additions & 3 deletions .github/workflows/ambar-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
- name: Prettier check
run: pnpm run format:check

- name: Test
run: cd core && pnpm test

- name: Build
run: cd core && pnpm build

- name: Test
run: cd core && pnpm test
138 changes: 138 additions & 0 deletions .github/workflows/ambar-task-explorer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: ambar-task-explorer

on:
pull_request:
types: [opened, reopened, synchronize]
paths:
- 'task-explorer/**'
push:
branches: [main]
paths:
- 'task-explorer/**'

run-name: ${{ github.workflow }} | ${{ github.event.pull_request.number }} ${{ github.event.pull_request.title || github.event.head_commit.message }}

env:
REGISTRY: ghcr.io
IMAGE_NAME: ambarltd/task-explorer

jobs:
test:
name: Test
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Install
run: pnpm install
env:
GITHUB_TOKEN: ${{ secrets.READ_ACCESS_TO_REPOS }}

- name: Prettier check
run: pnpm run format:check

- name: Build
run: cd task-explorer && ./utils.sh build

- name: Backend unit tests
run: cd task-explorer && ./utils.sh backend test

- name: Frontend tests
run: cd task-explorer && ./utils.sh frontend test

test-integration:
name: Integration Tests
runs-on: ubuntu-24.04
needs: test
services:
postgres:
image: docker.io/postgres:16.4
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Install
run: pnpm install
env:
GITHUB_TOKEN: ${{ secrets.READ_ACCESS_TO_REPOS }}

- name: Backend integration tests
# Postgres is provided as a CI service — skip docker-compose, run tsx directly
# (same command utils.sh backend test:integration runs internally)
run: cd task-explorer/backend && pnpm exec tsx tests/integration/main.ts
env:
TASKS_DB_HOST: localhost
TASKS_DB_PORT: "5432"
TASKS_DB_USER: postgres
TASKS_DB_PASSWORD: postgres
TASKS_DB_NAME: postgres
TASKS_DB_NAMESPACE: event_store
AUTH_USERNAME: admin
AUTH_PASSWORD: admin
SESSION_SECRET: test-secret

build-image:
name: Build Docker Image
runs-on: ubuntu-24.04
needs: [test, test-integration]
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build (PR)
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v6
with:
context: ./task-explorer
push: false
build-args: |
GITHUB_TOKEN=${{ secrets.READ_ACCESS_TO_REPOS }}

- name: Extract version
if: github.ref == 'refs/heads/main'
id: version
run: echo "value=$(node -p "require('./task-explorer/package.json').version")" >> $GITHUB_OUTPUT

- name: Build and push (main)
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6
with:
context: ./task-explorer
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.value }}
build-args: |
GITHUB_TOKEN=${{ secrets.READ_ACCESS_TO_REPOS }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ Thumbs.db
.env
.env.local
.env.*.local
# task-explorer uses placeholder-only .env files — safe to commit
!task-explorer/backend/.env
!task-explorer/backend/.env.test

# Test coverage
coverage/
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ node_modules
dist
pnpm-lock.yaml
*.log

# TanStack Router auto-generated file
**/routeTree.gen.ts
Loading
Loading