-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* testing github actions yml * adding comments for actions yml file * renamed yml for test * testing format actions * testing prettier push * on push test * another test on push * another test on push * testing check format * testing check format again * added lint * correcting lint run command * Fix lint errors, allow unused args prefixed with _ * Run tests * Tweak naming, remove unnecessary error check * Switch to containerized job, launch a postgres container, generate Prisma client * Configure and set up database * Fix db url * Tweak naming * Restore setup-node action for dependency caching, add --force to prisma command * Add name to step * Temporarily disable test run while license server is down --------- Co-authored-by: Francis Li <[email protected]>
- Loading branch information
Showing
19 changed files
with
125 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: CI | ||
on: [push] | ||
jobs: | ||
ci: | ||
name: CI | ||
runs-on: ubuntu-latest | ||
container: node:20.11.0-bookworm | ||
services: | ||
db: | ||
image: postgres:15.5 | ||
env: | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Set up npm cache | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Check Formatting | ||
run: npm run format:check | ||
- name: Run ESLint | ||
run: npm run lint --workspaces | ||
- name: Initialize database, generate Prisma client | ||
run: cd server; npx prisma migrate reset --force | ||
env: | ||
DATABASE_URL: postgresql://postgres@db/app | ||
- name: Run Tests | ||
if: ${{ false }} | ||
run: npm test | ||
env: | ||
DATABASE_URL: postgresql://postgres@db/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
export class LicenseMatchError extends Error { | ||
constructor(statusCode, message) { | ||
super(message) | ||
this.name = 'LicenseMatchError' | ||
this.statusCode = statusCode | ||
super(message); | ||
this.name = 'LicenseMatchError'; | ||
this.statusCode = statusCode; | ||
} | ||
} | ||
|
||
export class LicenseWebsiteError extends Error { | ||
constructor(statusCode, message) { | ||
super(message) | ||
this.name = 'LicenseWebsiteError' | ||
this.statusCode = statusCode | ||
super(message); | ||
this.name = 'LicenseWebsiteError'; | ||
this.statusCode = statusCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
'use strict'; | ||
|
||
import verifyLicense from "../../../../helpers/verifyLicense.js"; | ||
import verifyLicense from '../../../../helpers/verifyLicense.js'; | ||
|
||
export default async function (fastify) { | ||
fastify.get( | ||
'/', | ||
{ | ||
schema: { | ||
querystring: { | ||
license: { type: 'string' } | ||
} | ||
} | ||
license: { type: 'string' }, | ||
}, | ||
}, | ||
}, | ||
async function (request) { | ||
const { license } = request.query; | ||
const results = await verifyLicense(license); | ||
return results; | ||
}); | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export default async function (fastify, opts) { | ||
fastify.get('/', async function (request, reply) { | ||
export default async function (fastify, _opts) { | ||
fastify.get('/', async function (_request, _reply) { | ||
return 'this is an example'; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export default async function (fastify, opts) { | ||
fastify.get('/', async function (request, reply) { | ||
export default async function (fastify, _opts) { | ||
fastify.get('/', async function (_request, _reply) { | ||
return { root: true }; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters