-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add basic CI for
@bonfida/spl-name-service
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 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,58 @@ | ||
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: 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 | ||
- uses: ./.github/actions/prepare-local-env | ||
- name: Test source code | ||
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