Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
anchor

GitHub Action

Anchor Test

v1.3

Anchor Test

anchor

Anchor Test

An "anchor test" action that runs in ~1 minute

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Anchor Test

uses: metaDAOproject/[email protected]

Learn more about this action in metaDAOproject/anchor-test

Choose a version

Anchor Test

A fast, easy, and secure action for testing Anchor projects. Completes in ~1 minute.

Usage

Example workflow

Here's an example workflow:

name: example-workflow
on: [push]
jobs:
  run-anchor-test:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v3
      - uses: metadaoproject/[email protected]

This will use the default versions of Anchor, Node.js, and the Solana CLI tools, which are 0.27.0, 16.15.1, and 1.15.2 respectively.

Configuring versions

You can also configure these versions like so:

steps:
  - uses: actions/checkout@v3
  - uses: metadaoproject/[email protected]
    with:
      anchor-version: '0.24.2'
      solana-cli-version: '1.10.32'
      node-version: '16.15.1'

Cargo Features

You can pass in features to cargo via anchor test by using the features input:

steps:
  - uses: actions/checkout@v3
  - uses: metadaoproject/[email protected]
    with: 
      anchor-version: '0.24.2'
      solana-cli-version: '1.10.32'
      node-version: '16.15.1'
      features: 'my-feature'

This defaults to 'default'.

License

The scripts and documentation in this project are released under the MIT License.