From b5f64603f181617f1772fce2e4c151409c528eb9 Mon Sep 17 00:00:00 2001 From: worgho2 Date: Wed, 22 May 2024 00:04:47 -0300 Subject: [PATCH] feat: Add ci script --- .eslintignore | 3 +- .github/workflows/ci.yml | 32 ++++++++++++++++++++++ .prettierignore | 2 ++ .prettierrc.json | 10 ++++++- packages/client/tsconfig.json | 4 +-- packages/connection-gateway/tsconfig.json | 4 +-- packages/docs/src/components/Stoplight.tsx | 5 +++- 7 files changed, 53 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.eslintignore b/.eslintignore index dd22bdf..f3011a4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,4 +2,5 @@ _dev .sst coverage node_modules -dist \ No newline at end of file +dist +.docusaurus \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..817cc0c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: ['push', 'pull_request'] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Install dependencies, typecheck, lint, format, test + - run: | + npm ci + npm run typecheck + npm run lint + npx prettier --check . + npx jest --ci --coverage + env: + CI: true + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.prettierignore b/.prettierignore index bb716b7..575fb39 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,5 @@ .build .open-next sst-env.d.ts +.docusaurus +coverage \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json index 1b844b7..49508a9 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -5,5 +5,13 @@ "singleQuote": true, "printWidth": 100, "jsxSingleQuote": true, - "singleAttributePerLine": true + "singleAttributePerLine": true, + "overrides": [ + { + "files": "*.{yml,yaml}", + "options": { + "tabWidth": 2 + } + } + ] } diff --git a/packages/client/tsconfig.json b/packages/client/tsconfig.json index 7f5927f..1d5a45d 100644 --- a/packages/client/tsconfig.json +++ b/packages/client/tsconfig.json @@ -19,8 +19,8 @@ "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, - "strictNullChecks": true, + "strictNullChecks": true }, "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }], + "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/packages/connection-gateway/tsconfig.json b/packages/connection-gateway/tsconfig.json index 7b3c9b9..ea29644 100644 --- a/packages/connection-gateway/tsconfig.json +++ b/packages/connection-gateway/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "module": "CommonJS", "moduleResolution": "Node", - "strictNullChecks": true, - }, + "strictNullChecks": true + } } diff --git a/packages/docs/src/components/Stoplight.tsx b/packages/docs/src/components/Stoplight.tsx index 95bfa23..db6a823 100644 --- a/packages/docs/src/components/Stoplight.tsx +++ b/packages/docs/src/components/Stoplight.tsx @@ -9,7 +9,10 @@ interface StoplightProps { export function Stoplight({ apiDescriptionUrl }: Readonly) { return (
- +
); }