CI/CD Setup with Rojo + Wally + TestEZ?

My goal is to use the Open Cloud Engine API for automated tests. My current flow:
In my YAML file, I have wally install TestEZ, then run a script :

#!/bin/sh
set -e

$HOME/.aftman/bin/rojo build "$1" --output dist.rbxl
python3 scripts/python/upload_and_run_task.py dist.rbxl "$2"
rm dist.rbxl

adapted from the example given from roblox’s own example code where they use the Open Cloud Engine API ([Beta] Open Cloud Engine API for Executing Luau). when running the rojo build, it gives me the following output:

[ERROR rojo] Rojo project referred to a file using $path that could not be turned into a Roblox Instance by Rojo.
        Check that the file exists and is a file type known by Rojo.
        

the structure it’s importing looks like this:

        "Packages": {
            "$path": "Packages"
        },

but it say it cant find the folder Packages. I ensured that wally did correctly install TestEZ, and I tried structuring the import like so as well:

 "Packages": {
              "$className": "Folder",
              "_Index": {
                "$className": "Folder",
                "roblox_testez@0.4.1": {
                    "$className": "Folder",
                    "testez": {
                        "$path": "Packages/_Index/roblox_testez@0.4.1/testez/src"
                    }
                }
              },
              "TestEZ":{
                "$path": "Packages/TestEZ.lua"
              }
        },

to directly get it but didn’t get any success.

TLDR: when rojo is trying to build out the file, it encounters an error where it cant find the package TestEZ. Ive verified TestEZ is definitely being installed, but for some reason when built out on the pipeline, it can’t find it. I’m using GithubActions.

2 Likes

Just putting this here for documentation, but the issue was in the lack of understanding of how github actions actually works.

jobs:
  install-tools:
    name: Install tools
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3.3.0
      - name: Set up Aftman
        uses: ok-nick/setup-aftman@v0.4.2
      - name: Cache Aftman tools
        uses: actions/cache@v3
        with:
          path: ~/.aftman
          key: aftman-${{ hashFiles('aftman.toml') }}
      - name: Install Wally dependencies
        run: wally install

this was my previous yaml install job, but when it tried to run the new job,

luau-tests:
    name: Run Luau tests via Open Cloud
    runs-on: ubuntu-latest
    needs: [install-tools]
    concurrency:
      group: luau-execution
      cancel-in-progress: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v3.3.0
      - name: Restore cached Aftman tools
        uses: actions/cache@v3
        with:
          path: ~/.aftman
          key: aftman-${{ hashFiles('aftman.toml') }}
...etc...

I didn’t realize it moved to a clean environment (which should’ve been obvious from the caching in the first place), The solution is just a simple cache of the Packages directory.

jobs:
  install-tools:
    name: Install tools
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3.3.0
      - name: Set up Aftman
        uses: ok-nick/setup-aftman@v0.4.2
      - name: Cache Aftman tools
        uses: actions/cache@v3
        with:
          path: ~/.aftman
          key: aftman-${{ hashFiles('aftman.toml') }}
      - name: Install Wally dependencies
        run: wally install
      - name: Cache Wally Packages folder
        uses: actions/cache@v3
        with:
          path: Packages
          key: packages-${{ hashFiles('wally.lock') }}

  luau-tests:
    name: Run Luau tests via Open Cloud
    runs-on: ubuntu-latest
    needs: [install-tools]
    concurrency:
      group: luau-execution
      cancel-in-progress: false
    steps:
      - name: Checkout code
        uses: actions/checkout@v3.3.0
      - name: Restore cached Aftman tools
        uses: actions/cache@v3
        with:
          path: ~/.aftman
          key: aftman-${{ hashFiles('aftman.toml') }}
      - name: Restore Wally cache
        uses: actions/cache@v3
        with:
          path: Packages
          key: packages-${{ hashFiles('wally.lock') }}
...etc...

Know it makes me look stupid but I’m pretty sure other people who are also amateurs at CI/CD will need this so here it is.

1 Like