Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
25fe46f
start fresh
bennettrwu Oct 22, 2025
91ece02
build(git): configure git
bennettrwu Oct 23, 2025
186c80e
build(npm,tsc): configure npm workspaces and typescript
bennettrwu Oct 23, 2025
522f084
build(prettier): configure prettier code formatter
bennettrwu Oct 23, 2025
e3a5b1e
style: apply code formatting
bennettrwu Oct 23, 2025
00aa154
build(editorconfig): add editorconfig file that matches prettier config
bennettrwu Oct 23, 2025
4b3a3d0
build(eslint): configure eslint code linter
bennettrwu Oct 23, 2025
fec9f3c
build(vitest): configure vitest test runner
bennettrwu Oct 23, 2025
8a48197
build: setup hot reload tools
bennettrwu Oct 23, 2025
34f455e
build(docker): create dockerfile for monorepo application
bennettrwu Oct 23, 2025
5650717
ci(actions): create format, lint, build, and test github actions
bennettrwu Oct 23, 2025
d4f9e37
ci(actions): add workflow to report coverage on PRs
bennettrwu Oct 23, 2025
33b15fa
ci(actions): add job to build docker containers
bennettrwu Oct 23, 2025
85769a9
build(npm): bump npm minimum node version to match docker and actions…
bennettrwu Oct 23, 2025
0eabbe6
fix(actions): remove invalid coverage path
bennettrwu Oct 23, 2025
87c4855
fix(action): fix incorrect job step name for linter
bennettrwu Oct 23, 2025
97441a9
fix(actions): fix issue where only slowest container platform overrit…
bennettrwu Oct 23, 2025
d2c50b3
fix(action): fix invalid cache-from definition in docker build action
bennettrwu Oct 23, 2025
87f934d
fix(action): actually push built images in docker build action
bennettrwu Oct 23, 2025
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
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# https://editorconfig.org/
# This file helps configure your code editor to match the project's formatting convention
# You might need to install an extension to get support for .editorconfig (see editorconfig docs)

# Indicate this is the top-most EditorConfig file
root = true

# Ensure your editor matches Prettier settings
[*]
charset = utf-8
insert_final_newline = true
end_of_line = lf
indent_style = space
indent_size = 2
max_line_length = 80
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# https://git-scm.com/docs/gitattributes
# This file configures how git behaves for this repository

# * : For all files tracked by git:
# text=auto : Have git guess if it is a text file, if it is
# eol=lf : Ensure it has Unix line endings when checked out
# If need, add overrides below this line (e.g. *.bat text eol=crlf)
* text=auto eol=lf
92 changes: 92 additions & 0 deletions .github/actions/build-container/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: "Build Containers"
description: "Builds docker containers using provided config for linux/amd64 and linux/arm64."
inputs:
image_name:
description: "Container image name (e.g., scribear/app)."
required: true
build_context:
description: "Docker build context."
required: true
dockerfile:
description: "Path to the Dockerfile."
required: true
dockerhub_username:
description: "DockerHub username."
required: true
dockerhub_password:
description: "DockerHub password."
required: true
runs:
using: "composite"
steps:
# Generate tags and labels for the Docker image
- name: Generate Container Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ inputs.image_name }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ inputs.dockerhub_username }}
password: ${{ inputs.dockerhub_password }}

# Build different platforms first using independent buildcaches without pushing
# This ensures buildcache isn't overritten by other architectures, so builds can
# take actually advantage of caching (vs buildcache always containg the wrong architecture image)
- name: Build linux/amd64
uses: docker/build-push-action@v6
with:
push: false
context: ${{ inputs.build_context }}
file: ${{ inputs.dockerfile }}
platforms: "linux/arm64"
# Use build cache for faster builds
cache-from: |
type=registry,mode=max,ref=${{ inputs.image_name }}:buildcache-linux-amd64
cache-to: type=registry,mode=max,ref=${{ inputs.image_name }}:buildcache-linux-amd64

- name: Build linux/arm64
uses: docker/build-push-action@v6
with:
push: false
context: ${{ inputs.build_context }}
file: ${{ inputs.dockerfile }}
platforms: "linux/arm64"
# Use build cache for faster builds
cache-from: |
type=registry,mode=max,ref=${{ inputs.image_name }}:buildcache-linux-arm64
cache-to: type=registry,mode=max,ref=${{ inputs.image_name }}:buildcache-linux-arm64

# After independent builds, build images with all architectures combined and push
# Combining all architectures ensures that the final tagged image doesn't get overritten by the last architecture that pushes
# Instead a single tagged image that supports all architectures are created
# Since builds were run independently, this combined step can take advantage of all of the buildcaches
- name: Push Images
uses: docker/build-push-action@v6
with:
push: true
context: ${{ inputs.build_context }}
file: ${{ inputs.dockerfile }}
platforms: "linux/amd64,linux/arm64"
# Tag image with generated tags and labels
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Use build cache for faster builds
cache-from: |
type=registry,mode=max,ref=${{ inputs.image_name }}:buildcache-linux-amd64
type=registry,mode=max,ref=${{ inputs.image_name }}:buildcache-linux-amd64
66 changes: 66 additions & 0 deletions .github/actions/coverage-report/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "Coverage Report"
description: "Reads provided cobertura coverage report and adds a comment to the PR with the coverage summary."
inputs:
package_name:
description: "Package name for the coverage report title in PR comments."
required: true
# Inputs (except package_name) are the same as the arguments for irongut/CodeCoverageSummary@v1.3.0
# see: https://github.com/irongut/CodeCoverageSummary
filename:
description: "A cobertura file to load coverage data from."
required: true
badge:
description: ""
default: "true"
fail_below_min:
description: ""
default: "false"
format:
description: ""
default: markdown
hide_branch_rate:
description: ""
default: "false"
hide_complexity:
description: ""
default: "false"
indicators:
description: ""
default: "true"
output:
description: ""
default: both
thresholds:
description: ""
default: "50 75"
runs:
using: "composite"
steps:
- name: Code Coverage Report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: ${{ inputs.filename }}
badge: ${{ inputs.badge == 'true' }}
fail_below_min: ${{ inputs.fail_below_min == 'true' }}
format: ${{ inputs.format }}
hide_branch_rate: ${{ inputs.hide_branch_rate == 'true' }}
hide_complexity: ${{ inputs.hide_complexity == 'true' }}
indicators: ${{ inputs.indicators == 'true' }}
output: ${{ inputs.output }}
thresholds: ${{ inputs.thresholds }}

- name: Add Package Name To Comment
shell: bash
run: |
echo "## ${PACKAGE_NAME} Coverage Report" > tmp && cat code-coverage-results.md >> tmp && mv tmp code-coverage-results.md
env:
PACKAGE_NAME: ${{ inputs.package_name }}

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
# Use package_name as unique identifier for the comment it can be recreated if PR is updated
header: ${{ inputs.package_name }}
recreate: true
path: code-coverage-results.md
22 changes: 22 additions & 0 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Setup Node"
description: "Checks out the repo and installs dependencies for node packages."
inputs:
node-version:
description: "Node.js version to use for setup."
default: "24.10.0"
runs:
using: "composite"

steps:
- name: Set up Git repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}

- name: Install dependencies
working-directory: "."
shell: bash
run: npm ci
95 changes: 95 additions & 0 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Node CI

on:
push:
paths:
- apps/*
- libs/*
branches:
- main
- staging
tags:
- "v*.*.*"
pull_request:
workflow_dispatch:

permissions:
actions: read
contents: read
# Needed in order to add comments to PR
pull-requests: write

jobs:
check-formatting-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Check formatting
working-directory: "."
run: npm run format

run-linter-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Run linter
working-directory: "."
run: npm run lint

run-build-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Run build
working-directory: "."
run: npm run build

run-tests-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Run build
working-directory: "."
run: npm run build

- name: Run tests
working-directory: "."
run: npm run test

- name: Code Coverage Report - Session Manager
uses: ./.github/actions/coverage-report
with:
package_name: "Session Manager"
filename: "./apps/session-manager/coverage/cobertura-coverage.xml"

build-session-manager-container:
needs:
- check-formatting-node
- run-linter-node
- run-build-node
- run-tests-node
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4

- name: Build and Push Docker Image
uses: ./.github/actions/build-container
with:
image_name: "scribear/session-manager"
build_context: "."
dockerfile: "./apps/session-manager/Dockerfile"
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
Loading