Acton

CI integration

Learn how to set up Acton checks, tests, and reports in CI pipelines

This guide shows how to set up Acton in CI to catch issues before merging.

GitHub Actions

Acton offers an easy-to-use GitHub action for configuring Acton:

- name: Setup Acton
  uses: ton-blockchain/setup-acton@master

setup-acton downloads a release binary, adds it to PATH, and exposes acton-path output.

Learn more in setup-acton repository.

Full workflow example

.github/workflows/ci.yml
name: CI

on:
  pull_request:
  push:
    branches: [main]

jobs:
  validate:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Setup Acton
        uses: ton-blockchain/setup-acton@master

      - name: Verify version
        run: acton --version

      - name: Build
        run: acton build

      - name: Tests
        run: acton test

      - name: Lint
        run: acton check --output-format github

      - name: Format check
        run: acton fmt --check

Wallets and Secrets in CI

For non-interactive deployment/verification jobs, store mnemonics in CI secrets and use mnemonic-env.

wallets.toml
[wallets.deployer]
kind = "v5r1"
keys = { mnemonic-env = "DEPLOYER_MNEMONIC" }

Then inject the secret in your CI environment:

env:
  DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }}

See Setup wallets for all secure storage options.

Never commit mnemonic phrases or wallet files with plaintext secrets.

Coverage reports

Generate and upload coverage reports:

.github/workflows/ci.yml
name: Coverage

on:
  pull_request:
  push:
    branches: [main]

jobs:
  validate:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: Setup Acton
        uses: ton-blockchain/setup-acton@master

      - name: Verify version
        run: acton --version

      - name: Build
        run: acton build

      - name: Tests
        run: acton test --coverage --coverage-format lcov

      - name: Upload to Codecov
        uses: codecov/codecov-action@v4
        with:
          files: lcov.info
          token: ${{ secrets.CODECOV_TOKEN }}

GitLab CI

If you run CI on GitLab, you can use the published Acton Docker image. This example also uploads a GitLab Code Quality report for merge requests:

.gitlab-ci.yml
image: ghcr.io/ton-blockchain/acton:<version>

stages:
  - validate

validate:
  stage: validate
  script:
    - acton --version
    - acton build
    - acton test
    - acton check --output-format gitlab --output-file gl-code-quality-report.json
    - acton fmt --check
  artifacts:
    reports:
      codequality: gl-code-quality-report.json

Last updated on

On this page