-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[OPIK-927] [TypeScript SDK] Add CI/CD flows (#1257)
* [OPIK-927] Add lint / TS check / unit-tests to the GitHub actions * Add ESLint support + fix ESLint errors/warnings * Extend CI/CD linter to more folders
- Loading branch information
Showing
9 changed files
with
393 additions
and
117 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,35 @@ | ||
name: TypeScript SDK Linter | ||
run-name: "TypeScript SDK Linter ${{ github.ref_name }} by @${{ github.actor }}" | ||
on: | ||
pull_request: | ||
paths: | ||
- "sdks/typescript/**" | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- "sdks/typescript/**" | ||
workflow_dispatch: | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: sdks/typescript | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4.2.2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4.2.0 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: ESLint | ||
run: npm run lint | ||
|
||
- name: Type check | ||
run: npm run typecheck |
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,32 @@ | ||
name: TypeScript SDK Unit Tests | ||
run-name: "TypeScript SDK Unit Tests ${{ github.ref_name }} by @${{ github.actor }}" | ||
on: | ||
pull_request: | ||
paths: | ||
- "sdks/typescript/**" | ||
push: | ||
branches: | ||
- "main" | ||
paths: | ||
- "sdks/typescript/**" | ||
workflow_dispatch: | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: sdks/typescript | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4.2.2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4.2.0 | ||
with: | ||
node-version: "20" | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Unit tests | ||
run: npm run test |
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,12 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
/** @type {import('eslint').Linter.Config[]} */ | ||
export default [ | ||
{ ignores: ["dist/**", "node_modules/**", "src/opik/rest_api/**"] }, | ||
{ files: ["src/**/*.{js,mjs,cjs,ts}", "tests/**/*.{js,mjs,cjs,ts}"] }, | ||
{ languageOptions: { globals: globals.browser } }, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
]; |
Oops, something went wrong.