-
Notifications
You must be signed in to change notification settings - Fork 343
Integration, build tests for NAPI SDK #659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
WilfredAlmeida
wants to merge
25
commits into
master
Choose a base branch
from
STR-278-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c7956af
refactor ci
WilfredAlmeida 57e0d31
fix tests, install musl dependencies
WilfredAlmeida fee23f6
ci, test fix
WilfredAlmeida 4ac9333
fix ci
WilfredAlmeida 1af9d84
run on correct targets
WilfredAlmeida eed55c5
modify triggers
WilfredAlmeida 74adc28
add shell files for binary verification
WilfredAlmeida 96c9bfc
chmod shell scripts
WilfredAlmeida 1e676a5
fix test, validation
WilfredAlmeida e712173
test, binary validation fixes
WilfredAlmeida 7f82320
ignore errors after exit
WilfredAlmeida 5fc9aeb
test debnug
WilfredAlmeida a1b2e39
limited testing
WilfredAlmeida d9a017e
commit the correct file
WilfredAlmeida ec0d93a
run on macos-latest
WilfredAlmeida 6faa604
fix: typo in runner name
WilfredAlmeida 23431ec
fix rust install
WilfredAlmeida d079f4a
musl validation test should fail
WilfredAlmeida 244fa71
fix musl test
WilfredAlmeida a03b248
set workflow permissions
WilfredAlmeida fe1f5e6
cargo clean napi builds to clear space
WilfredAlmeida fd14473
refactor: bump package versions
WilfredAlmeida af43df6
Updating test to run in public runner, updating task to consume less
Juanito87 64a858d
UPD.
Juanito87 549379e
Removing unneeded task as it has been moved to the public runner.
Juanito87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,311 @@ | ||
| name: NAPI Integration Tests | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'yellowstone-grpc-client-nodejs/**' | ||
| - '.github/workflows/napi-integration-tests.yml' | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| NODE_VERSION: '20.18.0' | ||
|
|
||
| jobs: | ||
| # Linux x64 GNU (glibc) - Ubuntu | ||
| test-linux-x64-gnu: | ||
| name: Test Linux x64 GNU (glibc) | ||
| runs-on: ubuntu-22.04 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'npm' | ||
| cache-dependency-path: yellowstone-grpc-client-nodejs/package-lock.json | ||
|
|
||
| - name: Set rust version | ||
| run: | | ||
| RUST_VERSION="$(grep -oP 'channel = "\K\d\.\d+\.\d+(?=")' rust-toolchain.toml)" | ||
| echo "RUST_STABLE=$RUST_VERSION" | tee -a $GITHUB_ENV | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: ${{ env.RUST_STABLE }} | ||
| targets: x86_64-unknown-linux-gnu | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update -y | ||
| sudo apt-get install -y build-essential protobuf-compiler libsasl2-dev | ||
|
|
||
| - name: Install Node dependencies | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: npm ci | ||
|
|
||
| - name: Build NAPI binary for linux-x64-gnu | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| env: | ||
| NAPI_TARGET: x86_64-unknown-linux-gnu | ||
| LIBC: gnu | ||
| run: | | ||
| npm run build -- --platform --release --target x86_64-unknown-linux-gnu | ||
|
|
||
| - name: Validate binary (GNU libc) | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: | | ||
| chmod u+x ../ci/validate-binary.sh | ||
| ../ci/validate-binary.sh napi/yellowstone-grpc-napi.linux-x64-gnu.node gnu x86_64 | ||
|
|
||
| - name: Build TypeScript SDK | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: npm run build:dev | ||
|
|
||
| - name: Run tests | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| env: | ||
| TEST_ENDPOINT: ${{ secrets.TEST_ENDPOINT }} | ||
| TEST_TOKEN: ${{ secrets.TEST_TOKEN }} | ||
| run: npm test | ||
|
|
||
| - name: cargo clean | ||
| working-directory: yellowstone-grpc-client-nodejs/napi | ||
| run: | ||
| cargo clean | ||
|
|
||
| # Linux x64 MUSL - Alpine container | ||
| test-linux-x64-musl: | ||
| name: Test Linux x64 MUSL (Alpine) | ||
| runs-on: ubuntu-22.04 | ||
| container: | ||
| image: alpine:3.19 | ||
| env: | ||
| HOME: /root | ||
|
|
||
| steps: | ||
| - name: Install build dependencies in Alpine | ||
| run: | | ||
| apk add --no-cache \ | ||
| git \ | ||
| bash \ | ||
| sed \ | ||
| nodejs \ | ||
| npm \ | ||
| python3 \ | ||
| make \ | ||
| g++ \ | ||
| gcc \ | ||
| musl-dev \ | ||
| linux-headers \ | ||
| protobuf-dev \ | ||
| cyrus-sasl-dev \ | ||
| curl \ | ||
| file \ | ||
| binutils | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set rust version (BusyBox compatible) | ||
| run: | | ||
| RUST_VERSION="$(sed -n 's/channel = "\([0-9]\+\.[0-9]\+\.[0-9]\+\)".*/\1/p' rust-toolchain.toml)" | ||
| echo "RUST_STABLE=$RUST_VERSION" | tee -a $GITHUB_ENV | ||
| echo "Rust version: $RUST_VERSION" | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: ${{ env.RUST_STABLE }} | ||
| targets: x86_64-unknown-linux-musl | ||
|
|
||
| - name: Verify Rust installation | ||
| run: | | ||
| echo "PATH: $PATH" | ||
| which rustc | ||
| rustc --version | ||
| which cargo | ||
| cargo --version | ||
|
|
||
| - name: Install Node dependencies | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: npm ci | ||
|
|
||
| - name: Build NAPI binary for linux-x64-musl | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| env: | ||
| NAPI_TARGET: x86_64-unknown-linux-musl | ||
| LIBC: musl | ||
| run: | | ||
| npm run build -- --platform --release --target x86_64-unknown-linux-musl | ||
|
|
||
| - name: Validate binary (MUSL libc) | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: | | ||
| chmod u+x ../ci/validate-binary.sh | ||
| ../ci/validate-binary.sh napi/yellowstone-grpc-napi.linux-x64-musl.node musl x86_64 | ||
|
|
||
| - name: Build TypeScript SDK | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: npm run build:dev | ||
|
|
||
| - name: Run tests | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| env: | ||
| TEST_ENDPOINT: ${{ secrets.TEST_ENDPOINT }} | ||
| TEST_TOKEN: ${{ secrets.TEST_TOKEN }} | ||
| run: npm test | ||
|
|
||
| - name: cargo clean | ||
| working-directory: yellowstone-grpc-client-nodejs/napi | ||
| run: | ||
| cargo clean | ||
|
|
||
| # macOS x64 (Intel) | ||
| test-macos-x64: | ||
|
|
||
| name: Test macOS x64 (Intel) | ||
| runs-on: macos-15-intel | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'npm' | ||
| cache-dependency-path: yellowstone-grpc-client-nodejs/package-lock.json | ||
|
|
||
| - name: Set rust version | ||
| run: | | ||
| RUST_VERSION="$(sed -n 's/^channel = "\([0-9.]*\)"/\1/p' rust-toolchain.toml)" | ||
| echo "RUST_STABLE=$RUST_VERSION" | tee -a "$GITHUB_ENV" | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: ${{ env.RUST_STABLE }} | ||
| targets: x86_64-apple-darwin | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| brew install protobuf | ||
|
|
||
| - name: Install Node dependencies | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: npm ci | ||
|
|
||
| - name: Build NAPI binary for darwin-x64 | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| env: | ||
| NAPI_TARGET: x86_64-apple-darwin | ||
| run: | | ||
| npm run build -- --platform --release --target x86_64-apple-darwin | ||
|
|
||
| - name: Validate binary (macOS x64) | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: | | ||
| chmod u+x ../ci/validate-binary-macos.sh | ||
| ../ci/validate-binary-macos.sh napi/yellowstone-grpc-napi.darwin-x64.node x86_64 | ||
|
|
||
| - name: Build TypeScript SDK | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: npm run build:dev | ||
|
|
||
| - name: Run tests | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| env: | ||
| TEST_ENDPOINT: ${{ secrets.TEST_ENDPOINT }} | ||
| TEST_TOKEN: ${{ secrets.TEST_TOKEN }} | ||
| run: npm test | ||
|
|
||
| - name: cargo clean | ||
| working-directory: yellowstone-grpc-client-nodejs/napi | ||
| run: | ||
| cargo clean | ||
|
|
||
| # macOS ARM64 (Apple Silicon) | ||
| test-macos-arm64: | ||
| name: Test macOS ARM64 (Apple Silicon) | ||
| runs-on: macos-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'npm' | ||
| cache-dependency-path: yellowstone-grpc-client-nodejs/package-lock.json | ||
|
|
||
| - name: Set rust version | ||
| run: | | ||
| RUST_VERSION="$(sed -n 's/^channel = "\([0-9.]*\)"/\1/p' rust-toolchain.toml)" | ||
| echo "RUST_STABLE=$RUST_VERSION" | tee -a "$GITHUB_ENV" | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: ${{ env.RUST_STABLE }} | ||
| targets: x86_64-apple-darwin | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| brew install protobuf | ||
|
|
||
| - name: Install Node dependencies | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: npm ci | ||
|
|
||
| - name: Build NAPI binary for darwin-arm64 | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| env: | ||
| NAPI_TARGET: aarch64-apple-darwin | ||
| run: | | ||
| npm run build -- --platform --release --target aarch64-apple-darwin | ||
|
|
||
| - name: Validate binary (macOS ARM64) | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: | | ||
| chmod u+x ../ci/validate-binary-macos.sh | ||
| ../ci/validate-binary-macos.sh napi/yellowstone-grpc-napi.darwin-arm64.node arm64 | ||
|
|
||
| - name: Build TypeScript SDK | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| run: npm run build:dev | ||
|
|
||
| - name: Run tests | ||
| working-directory: yellowstone-grpc-client-nodejs | ||
| env: | ||
| TEST_ENDPOINT: ${{ secrets.TEST_ENDPOINT }} | ||
| TEST_TOKEN: ${{ secrets.TEST_TOKEN }} | ||
| run: npm test | ||
|
|
||
| - name: cargo clean | ||
| working-directory: yellowstone-grpc-client-nodejs/napi | ||
| run: | ||
| cargo clean | ||
|
|
||
| # Release gate - all tests must pass | ||
| integration-tests-complete: | ||
|
|
||
| name: All Integration Tests Passed | ||
| needs: [test-linux-x64-gnu, test-linux-x64-musl, test-macos-x64, test-macos-arm64] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Mark as complete | ||
| run: echo "All NAPI integration tests passed successfully" | ||
|
|
||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.