This document describes the Continuous Integration and Continuous Deployment (CI/CD) pipeline used in the Ava SDK JS repository.
This document describes the Continuous Integration and Continuous Deployment (CI/CD) pipeline used in the Ava SDK JS repository. It covers the automated processes for testing, version management, and release creation to ensure code quality and streamline development workflows.
For information about the release management process, see Release Management.
The AVA SDK JS repository uses GitHub Actions to implement its CI/CD pipeline. The pipeline consists of several workflows that handle testing in different environments, version management with Changesets, and automated releases.
Sources:
When a pull request is created, it triggers automated tests in development and staging environments based on the target branch. The testing workflows check for changes in source code or test files and run a series of tests to verify functionality.
Sources:
The development environment testing workflow runs whenever a pull request is created. It uses a local Docker container to run the AVS aggregator service for testing.
Key characteristics:
localhost:2206 endpointTest workflow steps:
Check for changes in source code directories
Start local AVS aggregator in Docker
Install dependencies and build the project
Create a test API key
Run tests for various SDK functionalities:
Sources:
The staging environment testing workflow runs when a pull request targets the main branch. It uses a remote staging environment for testing.
Key characteristics:
mainENDPOINT environment variableThe staging test workflow follows the same test execution pattern as the development workflow but uses predefined API keys and endpoints for the staging environment.
Sources:
The repository uses Changesets to manage versioning and changelog generation. Changesets provide a way to document changes and automate version bumping.
The changeset workflow allows developers to:
Sources:
The record-changeset.yml workflow automates the process of creating a changeset. It can be manually triggered through the GitHub Actions interface with the following steps:
.changeset directorymain or staging branchSources:
The release process is automated through the create-release.yml workflow. This workflow is triggered manually on the main branch and handles version bumping and release creation.
Key steps in the release process:
npx changeset version to process pending changesetsmain branchpackage.json has increasedThe release workflow only creates a new release if a version increment is detected between the current version and the latest release.
Sources:
The CI/CD pipeline includes comprehensive testing of all SDK functionality. Tests are executed against both development and staging environments.
The testing process verifies all core functionality of the SDK:
| Test Category | Functions Tested | Purpose |
|---|---|---|
| Authentication | authWithAPIKey, authWithSignature | Verify authentication methods |
| Workflow Management | createWorkflow, getWorkflow, getWorkflows, cancelWorkflow, deleteWorkflow | Test workflow lifecycle management |
| Execution | getExecutions | Verify execution retrieval |
| Wallet Management | getWallet, getWallets | Test wallet retrieval functions |
| Secret Management | Secret creation, listing, updating, deletion | Verify secret management capabilities |
Sources:
The CI/CD pipeline uses different environment configurations for development and staging tests. These configurations are managed through GitHub secrets and environment variables.
Key environment variables:
TEST_API_KEY: API key for authenticationTEST_PRIVATE_KEY: Private key for signature-based authenticationENDPOINT: Service endpoint (localhost for dev, remote for staging)CHAIN_ENDPOINT: Blockchain endpoint for testsRUN_ID: Unique identifier for the test run (staging only)Sources:
The CI/CD pipeline for Ava SDK JS provides a robust system for testing, versioning, and releasing code. It ensures that all changes are properly tested in both development and staging environments before being released. The use of Changesets simplifies version management and changelog generation, making the release process more reliable and transparent.