Skip to content

Commit

Permalink
feat: Add basic CI for @bonfida/spl-name-service
Browse files Browse the repository at this point in the history
  • Loading branch information
letehaha committed Dec 5, 2023
1 parent cf9910f commit b35123e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/check-spl-name-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Check spl-name-service

on:
push:
branches: [main]
paths:
- 'js/**'
pull_request:
branches: [main]
paths:
- 'js/**'

defaults:
run:
working-directory: ./js

jobs:
prepare-dependencies:
name: Prepare local deps
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node
# Use Node version specified in Volta config inside package.json
uses: volta-cli/action@v4
# - name: Get npm cache directory
# shell: bash
# id: npm-cache-dir
# run: |
# echo "::set-output name=dir::$(npm config get cache)"
# - uses: actions/cache@v3
# id: npm-cache
# with:
# path: |
# **/node_modules
# ${{ steps.npm-cache-dir.outputs.dir }}
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
- name: Log Node version and working directory
run: echo $(node -v) && pwd
- name: Use cache or install dependencies
# if: steps.prepare-env.outputs.cache-hit != 'true'
run: npm ci
- name: Make envfile
uses: SpicyPizza/[email protected]
with:
envkey_RPC_URL: ${{ secrets.RPC_URL }}

test:
name: Test source code
needs: prepare-dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Test
run: echo $(ls) && cd node_modules && echo $(ls)
- name: Test source code
run: npm run test
4 changes: 4 additions & 0 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"lint:fix": "yarn pretty:fix && eslint . --fix",
"pretty": "prettier --check 'src/*.[jt]s'",
"pretty:fix": "prettier --write 'src/*.[jt]s'",
"test": "jest ./tests",
"doc": "yarn typedoc src/index.ts"
},
"devDependencies": {
Expand Down Expand Up @@ -77,5 +78,8 @@
},
"peerDependencies": {
"@solana/web3.js": "^1.87.3"
},
"volta": {
"node": "20.10.0"
}
}

0 comments on commit b35123e

Please sign in to comment.