Skip to content

Commit

Permalink
ci: 👷 update ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Jan 13, 2024
1 parent 54612c5 commit d82cb6c
Show file tree
Hide file tree
Showing 6 changed files with 5,762 additions and 3,154 deletions.
48 changes: 32 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,49 +3,65 @@ name: CI
on: [pull_request]

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1

- name: Load cached modules
uses: actions/cache@v2
uses: actions/cache@v3.3.3
with:
path: |
**/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- name: Load Node.js latest
uses: actions/setup-node@v2-beta
uses: actions/setup-node@v4.0.1
with:
node-version: '20.x'

- name: Install all dependencies
run: npm ci

- name: Compile TypeScript and build Library files
run: npm run build
- name: Run ESLint
run: npm run lint
build:
name: build
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]

lint:
name: lint
- uses: actions/[email protected]
with:
path: |
**/node_modules
**/lib
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- uses: actions/[email protected]
with:
node-version: '20.x'

- run: npm run build
test:
name: test
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- uses: actions/[email protected]

- name: Use Node.js latest
uses: actions/setup-node@v2-beta
- uses: actions/[email protected]
with:
node-version: '20.x'

- name: Get cached modules
uses: actions/[email protected]
- uses: actions/[email protected]
with:
path: |
**/node_modules
**/lib
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- name: Run ESLint
run: npm run lint
- name: Test
run: npm run test:nobuild
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.idea
.vscode
.vscode/settings.json
coverage
/commonjs/
lib
Expand Down
67 changes: 67 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"command": "npm run build",
"type": "shell",
"args": [],
"isBackground": true,
"problemMatcher": [],
"icon": {
"id": "symbol-method",
"color": "terminal.ansiBlue"
}
},
{
"label": "Test with Jest",
"command": "npm test",
"type": "shell",
"args": [],
"isBackground": true,
"problemMatcher": [],
"icon": {
"id": "go-to-file",
"color": "terminal.ansiGreen"
}
},
{
"label": "Test without Building",
"command": "npm run test:nobuild",
"type": "shell",
"args": [],
"isBackground": true,
"problemMatcher": [],
"icon": {
"id": "go-to-file",
"color": "terminal.ansiGreen"
}
},
{
"label": "Open Test Coverage",
"command": "npm run lcov",
"type": "shell",
"args": [],
"isBackground": true,
"problemMatcher": [],
"icon": {
"id": "file-code",
"color": "terminal.ansiYellow"
}
}
],
"extensions": {
"recommendations": [
"prettier.prettier-vscode",
"dbaeumer.vscode-eslint",
"steoates.autoimport",
"vivaxy.vscode-conventional-commits",
"usernamehw.errorlens",
"usernamehw.remove-empty-lines",
"aljazsim.tsco"
]
},
"settings": {
"typescript.tsdk": "node_modules/typescript/lib"
}
}
2 changes: 0 additions & 2 deletions babel.config.js → babel.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line no-undef
module.exports = {
presets: [
[
Expand All @@ -7,7 +6,6 @@ module.exports = {
targets: {
esmodules: true,
},
// modules: "umd", -- THIS IS FOR DOING THE LIB VERSION OF KEEPTRACK
},
],
'@babel/preset-typescript',
Expand Down
Loading

0 comments on commit d82cb6c

Please sign in to comment.