Skip to content

Commit

Permalink
Merge dev for v1.1.0 release (#926)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswilty authored Oct 24, 2024
2 parents 9ba0435 + 501e4be commit c59a2f6
Show file tree
Hide file tree
Showing 77 changed files with 17,157 additions and 2,859 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
**/dist/
**/test/
**/jest*
**/tsconfig.test.json
**/vitest*
**/.env*
**/.eslint*
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/backend-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- main
- dev
- 'feature/**'
paths:
- 'backend/**'

Expand All @@ -20,7 +21,6 @@ jobs:
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -30,19 +30,21 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./backend/package-lock.json"
cache: 'npm'
cache-dependency-path: './backend/package-lock.json'
- name: Install dependencies
run: |
npm ci --no-audit
- name: Run job
run: |
npm ci
npx eslint .
npx prettier . --check
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -52,10 +54,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./backend/package-lock.json"
cache: 'npm'
cache-dependency-path: './backend/package-lock.json'
- name: Install dependencies
run: |
npm ci --no-audit
- name: Run job
run: |
npm ci
npm run build
npm test
41 changes: 41 additions & 0 deletions .github/workflows/cloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Cloud Code Checks

on:
workflow_dispatch:
pull_request:
branches:
- main
- dev
- 'feature/**'
paths:
- 'cloud/**'

defaults:
run:
working-directory: ./cloud

jobs:
lint-format:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
sparse-checkout: |
.prettierrc
cloud
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: './cloud/package-lock.json'
- name: Install dependencies
run: |
npm ci --no-audit
- name: Run job
run: |
npm run codecheck
20 changes: 12 additions & 8 deletions .github/workflows/frontend-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- main
- dev
- 'feature/**'
paths:
- 'frontend/**'

Expand All @@ -20,7 +21,6 @@ jobs:
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -30,20 +30,22 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./frontend/package-lock.json"
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- name: Install dependencies
run: |
npm ci --no-audit
- name: Run job
run: |
npm ci
npx eslint .
npx stylelint '**/*.css'
npx prettier . --check
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -53,10 +55,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./frontend/package-lock.json"
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- name: Install dependencies
run: |
npm ci --no-audit
- name: Run job
run: |
npm ci
npm run build
npm test
9 changes: 5 additions & 4 deletions .github/workflows/k6-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -30,10 +29,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./k6/package-lock.json"
cache: 'npm'
cache-dependency-path: './k6/package-lock.json'
- name: Install dependencies
run: |
npm ci --no-audit
- name: Run job
run: |
npm ci
npx eslint .
npx prettier . --check
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ pids
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
# Coverage and test output
lib-cov
coverage
*.lcov
reports

# node-waf configuration
.lock-wscript
Expand Down
1 change: 1 addition & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
build
reports
test
.env*
.eslintrc.cjs
Expand Down
2 changes: 1 addition & 1 deletion backend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json', './test/tsconfig.json'],
project: ['./tsconfig.json', 'test/tsconfig.json'],
},
plugins: ['@typescript-eslint', 'jest'],
ignorePatterns: ['build', 'coverage', 'node_modules'],
Expand Down
1 change: 0 additions & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM node:lts-alpine
ENV NODE_ENV=production

WORKDIR /usr/app
COPY package*.json ./
Expand Down
2 changes: 1 addition & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# prompt-injection-api
# SpyLogic : API

This is the backend module of the SpyLogic app. We are using [Express](https://expressjs.com/) to serve the API.

Expand Down
9 changes: 6 additions & 3 deletions backend/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ const jestConfig: JestConfigWithTsJest = {
'^@src/(.*)': '<rootDir>/src/$1',
importMetaUtils$: '<rootDir>/test/importMetaUtils.mock.ts',
},
modulePathIgnorePatterns: ['build', 'coverage', 'node_modules'],
testEnvironment: 'node',
transform: {
'^.+\\.ts$': [
'ts-jest',
{
tsconfig: './test/tsconfig.json',
tsconfig: '<rootDir>/test/tsconfig.json',
useESM: true,
},
],
},
silent: true,
setupFiles: ['./test/setupEnvVars.ts'],
setupFiles: ['<rootDir>/test/setupEnvVars.ts'],
reporters:
process.env.CI === 'true'
? ['default', ['jest-junit', { outputDirectory: 'reports' }]]
: ['default'],
};

export default jestConfig;
Loading

0 comments on commit c59a2f6

Please sign in to comment.