Skip to content

Commit

Permalink
fix: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
oscnord committed Mar 28, 2024
1 parent 1152ad5 commit 33a44f3
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 29 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Linting
on: [pull_request]

jobs:
lint:
if: "!contains(github.event.pull_request.title, 'WIP!')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install Dependencies
run: npm ci
- name: Run Eslint
run: npm run lint
17 changes: 17 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Prettier
on: [pull_request]

jobs:
pretty:
if: "!contains(github.event.pull_request.title, 'WIP!')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install Dependencies
run: npm ci
- name: Run Prettier
run: npm run pretty
26 changes: 12 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
name: Run tests
on: push
name: Unit Tests
on: [push]

jobs:
test:
unittests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies and run tests
run: |
npm install
npm test
node-version: '18.x'
- name: Install Dependencies
run: npm ci
- name: Run Unit Tests
run: npm test
17 changes: 17 additions & 0 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Type Check
on: [pull_request]

jobs:
ts:
if: "!contains(github.event.pull_request.title, 'WIP!')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install Dependencies
run: npm ci
- name: Run Type Check
run: npm run typecheck
24 changes: 24 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */

/* JavaScript Support */
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */,
"checkJs": true /* Enable error reporting in type-checked JavaScript files. */,

/* Emit */
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
"declarationMap": true /* Create sourcemaps for d.ts files. */,
"sourceMap": true /* Create source map files for emitted JavaScript files. */,

/* Interop Constraints */
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,

/* Completeness */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
}
29 changes: 14 additions & 15 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@

// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist",
"resolveJsonModule": true,
"strictNullChecks": true,
"declaration": true,
"declarationDir": "./dist"
},
"lib": ["es2016"],
"include": ["src", "types"],
/* Visit https://aka.ms/tsconfig to read more about this file */

/* Language and Environment */
"target": "es2022" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"lib": [
"es2022"
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,

/* Modules */
"module": "commonjs" /* Specify what module code is generated. */,
"resolveJsonModule": true /* Enable importing .json files. */,
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */
}
}

0 comments on commit 33a44f3

Please sign in to comment.