Skip to content

Commit

Permalink
ci: run default ci
Browse files Browse the repository at this point in the history
  • Loading branch information
graykode committed Apr 2, 2024
1 parent 230d837 commit f191ca3
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Clober DEX CI
on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
tests:
name: NPM Test
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [ '18.10' ]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install Dependencies
run: npm ci
- name: Run test
run: npm run test

check-lint:
name: Check TS
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [ '18.10' ]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install Dependencies
run: npm ci
- name: Check Ts Style
run: npm run lint
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"url": "git+https://github.com/clober-dex/v2-sdk.git"
},
"scripts": {
"lint": "eslint --ext .ts src --fix",
"docs": "typedoc --out docs src/index.ts --sort source-order",
"test": "vitest --root test --config vitest.config.ts",
"clean": "rm -rf dist && rm -rf src/.graphclient",
Expand Down

0 comments on commit f191ca3

Please sign in to comment.