Skip to content

Setup Dojo

Actions
Sets up the dojo-engine toolset to the action
v0.1
Latest
Star (1)

Dojo Logo

dojo-setup

Quickly install all required dependencies to test your dojo project


dojo-setup is a small action that automatically downloads and sets up a working dojo environment.

Get started

You can use the following example to quickly test your project after each commit and pull request.

name: Test contracts
on:
  # Replace this section with the branches in use in your own repository.
    push:
      branches:
        - "main"
    pull_request:
      branches:
        - "main"

permissions:
  contents: read

jobs:
  slot-deployment:
    runs-on: ubuntu-latest

    steps:
      - name: Setup repo
        uses: actions/checkout@v4

      - id: Setup Dojo
        uses: runelabsxyz/setup-dojo@main
        with:
          version: "v1.0.1"

      - name: Build contract
        # Add the following line if your contract is not at the root of the project.
        # working-directory: ./contracts
        run: sozo build

      - name: Test contract
        # Add the following line if your contract is not at the root of the project.
        # working-directory: ./contracts
        run: sozo test

With Explicit Scarb Version

For cases where the .tool-versions file in the Dojo release doesn't match the required Scarb version:

      - id: Setup Dojo
        uses: runelabsxyz/setup-dojo@main
        with:
          version: "1.8.0"
          scarb-version: "2.13.1"

      - name: Build contract
        run: sozo build

      - name: Test contract
        run: sozo test

Configuration

[!INFO] We are still working in improving this action, so configuration is limited for now.

Parameter type description
version string The version of dojo to install. This would be the parameter you provide to dojoup.
scarb-version string (Optional) Explicit scarb version to use (overrides .tool-versions).

Development

This actions uses the dojoup tool provided by the dojo engine organization to install a ready-to-use developpment environment for github actions.

TODO

  • Add support for version extraction from the asdf file
  • Add cache support to improve the speed of builds

Setup Dojo is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Sets up the dojo-engine toolset to the action
v0.1
Latest

Setup Dojo is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.