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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
AWS_PROFILE=runway
INIT_TOKEN="abc"
INIT_JOB_URL="http://host.docker.internal:3001/init"

APP_PORT=3001
JOB_ID=2
MOCK_S3=True
PG_JOBS_DB_HOST=db
PG_JOBS_DB_PORT=5432
PG_JOBS_DB_DATABASE=jobs
PG_JOBS_DB_USER=postgres
PG_JOBS_DB_PW=securepassword


165 changes: 165 additions & 0 deletions .github/workflows/app_ci_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: app-ci-pipeline

on:
pull_request:
branches: [main, development]
paths:
- "app/**"

defaults:
run:
working-directory: ./app # Applies only to `run` steps, not `uses` steps

jobs:
audit:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
cache-dependency-path: "app/package-lock.json"
- name: Install Node.js dependencies
run: npm ci
- name: Sandworm Audit
run: npm run sandworm

# lint:
# runs-on: ubuntu-latest

# strategy:
# matrix:
# node-version: [22.x]
# # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

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

# - uses: actions/checkout@v2
# - name: Setup Node.js
# uses: actions/setup-node@v2
# with:
# node-version: 22
# cache: "npm"

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

# - name: Generate Prisma client
# run: npm run prisma:generate-client

# - name: Lint
# run: npm run lint

build_api:
runs-on: ubuntu-latest
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# node-version: [22.x, 24.x] # TODO: test w/ 24.x as we get closer to the active LTS date
node-version: [22.x]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
cache-dependency-path: "app/package-lock.json" # Point to app directory
- name: Install Node.js dependencies
run: npm ci
- name: Generate Prisma client
run: npm run prisma:generate-client
- name: Build API
run: npm run api:build

typecheck_api:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
cache-dependency-path: "app/package-lock.json"
- name: Install Node.js dependencies
run: npm ci
- name: Generate Prisma client
run: npm run prisma:generate-client
- name: Typecheck API
run: npm run api:typecheck

build_fe:
runs-on: ubuntu-latest
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# node-version: [22.x, 24.x] # TODO: test w/ 24.x as we get closer to the active LTS date
node-version: [22.x]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
cache-dependency-path: "app/package-lock.json"
- name: Install Node.js dependencies
run: npm ci
- name: Build FE
run: npm run fe:build

typecheck_fe:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
cache-dependency-path: "app/package-lock.json"
- name: Install Node.js dependencies
run: npm ci
- name: Generate Prisma client
run: npm run prisma:generate-client
- name: Typecheck FE
run: npm run fe:typecheck

test:
runs-on: ubuntu-latest
strategy:
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# node-version: [22.x, 24.x] # TODO: test w/ 24.x as we get closer to the active LTS date
node-version: [22.x]

steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "npm"
cache-dependency-path: "app/package-lock.json"
- name: Install Node.js dependencies
run: npm ci
- name: Generate Prisma client
run: npm run prisma:generate-client
- name: Test API
run: npm run api:test
- name: Test Utils
run: npm run utils:test
34 changes: 34 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CFN Lint

on:
pull_request:
branches:
- 'development'
- 'main'

jobs:
security-scan:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install cfn-lint
pip install checkov
- name: CFN Lint Templates
run: |
cfn-lint $(git ls-files './cloudformation/templates/*.yml') --include-checks I
- name: Checkov
run: |
checkov --directory cloudformation/templates/ --quiet
49 changes: 49 additions & 0 deletions .github/workflows/semantic_version_compare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Compare template versions

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- cloudformation/**

jobs:
version_check:
runs-on: ubuntu-latest

steps:
- name: Checkout Compare Branch
uses: actions/checkout@v4
with:
ref: ${{github.ref}}

# - name: current directory
# run: ls -la

- name: Get New Version
id: get_new_version
run: |
new_version=$(grep -m 1 "Value: '[0-9]*\.[0-9]*\.[0-9]*'" ./cloudformation/templates/1-main.yml | awk -F"'" '{print $2}')
echo "new_version=$new_version" >> $GITHUB_OUTPUT
echo "${new_version}"

- name: Checkout Base Branch
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.base.ref}}

- name: Get Current Version
id: get_current_version
run: |
current_version=$(grep -m 1 "Value: '[0-9]*\.[0-9]*\.[0-9]*'" ./cloudformation/templates/1-main.yml | awk -F"'" '{print $2}')
echo "current_version=$current_version" >> $GITHUB_OUTPUT
echo "${current_version}"

- name: Compare Version Numbers
id: compare_versions
run: |
if [ "$(printf '%s\n' "${{ steps.get_current_version.outputs.current_version }}" "${{ steps.get_new_version.outputs.new_version }}" | sort -V | tail -n1)" = "${{ steps.get_current_version.outputs.current_version }}" ]; then
echo "Error: Please adjust version on new branch. It must be greater than version on base branch. Base branch version is ${{ steps.get_current_version.outputs.current_version }} and incoming branch version is ${{ steps.get_new_version.outputs.new_version }}"
exit 1
else
echo "Version check passed"
fi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.env
app/node_modules/
storage/
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"nrwl.angular-console",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner"
]
}
77 changes: 77 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "NestJS API",
"request": "attach",
"type": "node",
"port": 9229,
"restart": true,
// "sourceMapPathOverrides": {
// "webpack:///./*": "${workspaceFolder}/api/*"
// }
"cwd": "${workspaceRoot}/app/api"
},
{
"name": "Debug Jest Integration Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/app/node_modules/.bin/jest",
"--runInBand",
"--config",
"app/api/jest.config.integration.ts"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},

{
"name": "ts-node",
"type": "node",
"request": "launch",
"args": ["${relativeFile}"],
"runtimeArgs": [
"-r",
"ts-node/register",
"-r",
"tsconfig-paths/register"
],
"env": {
"TS_NODE_PROJECT": "tsconfig.base.json"
},
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal"
},
{
"name": "ts-node:api",
"type": "node",
"request": "launch",
"args": ["${relativeFile}"],
"runtimeArgs": [
"-r",
"ts-node/register",
"-r",
"tsconfig-paths/register"
],
"env": {
"TS_NODE_PROJECT": "api/tsconfig.app.json"
},
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal"
},
{
"type": "msedge",
"request": "launch",
"name": "Launch client",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}/app/fe/"
}
]
}
Loading