Skip to content

Commit

Permalink
chore: Add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
quangkeu95 committed Jan 1, 2025
1 parent ab0eb4d commit d8baa9a
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/actions/setup-anchor/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Setup anchor-cli"
description: "Setup node js and anchor cli"
runs:
using: "composite"
steps:
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install -g @coral-xyz/anchor-cli@${{ env.ANCHOR_CLI_VERSION }} yarn
shell: bash
7 changes: 7 additions & 0 deletions .github/actions/setup-dep/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: "Setup"
description: "Setup program dependencies"
runs:
using: "composite"
steps:
- run: sudo apt-get update && sudo apt-get install -y pkg-config build-essential libudev-dev
shell: bash
21 changes: 21 additions & 0 deletions .github/actions/setup-solana/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Setup Solana"
description: "Setup Solana"
runs:
using: "composite"
steps:
- uses: actions/cache@v2
name: Cache Solana Tool Suite
id: cache-solana
with:
path: |
~/.cache/solana/
~/.local/share/solana/
key: solana-${{ runner.os }}-v0000-${{ env.SOLANA_CLI_VERSION }}
- run: sh -c "$(curl -sSfL https://release.solana.com/v${{ env.SOLANA_CLI_VERSION }}/install)"
shell: bash
- run: echo "$HOME/.local/share/solana/install/active_release/bin/" >> $GITHUB_PATH
shell: bash
- run: solana-keygen new --no-bip39-passphrase
shell: bash
- run: solana config set --url localhost
shell: bash
48 changes: 48 additions & 0 deletions .github/workflows/ci_ts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Typescript SDK CI

on:
pull_request:
paths-ignore:
- "config/**"
- "README.md"
- "LICENSE"
- ".editorconfig"
branches:
- main

env:
SOLANA_CLI_VERSION: 1.16.3
NODE_VERSION: 18.14.2
ANCHOR_CLI_VERSION: 0.28.0

jobs:
sdk_changed_files:
runs-on: ubuntu-latest
outputs:
sdk: ${{steps.changed-files-specific.outputs.any_changed}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/[email protected]
with:
files: |
src
sdk_test:
runs-on: ubuntu-latest
needs: sdk_changed_files
if: needs.sdk_changed_files.outputs.sdk == 'true'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-solana
- uses: ./.github/actions/setup-dep
- uses: ./.github/actions/setup-anchor
- uses: oven-sh/setup-bun@v2
# This much more faster than anchor localnet
- run: bun run start-test-validator & sleep 2
shell: bash
- run: bun test
shell: bash

0 comments on commit d8baa9a

Please sign in to comment.