Running in CI
bedrock-core/setup-regolith is a GitHub Action that downloads the Regolith CLI, adds it to PATH, and registers resolvers, so a workflow step can run a profile the way you do locally.
Usage
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Set up Regolith
uses: bedrock-core/setup-regolith@1.0.1
with:
regolith-version: '1.8.0'
resolvers: |
github.com/bedrock-core/regolith-filters
Add the steps from your package manager after Set up Regolith:
- npm
- yarn
- pnpm
- name: Install project dependencies
run: npm ci
- name: Install declared filters
run: npm run regolith-install
- name: Build the addon
run: npm run build
- name: Build the GameTest pack
run: npm run build:test
- name: Run GameTests
run: npx --yes @bedrock-core/bds-runner@0.1.0 run --packs ./build/test/BP --tag example --expect-registered 1 --bds-version 1.26.51.1
- name: Enable Yarn Berry through Corepack
run: corepack enable
- name: Install project dependencies
run: yarn install --immutable
- name: Install declared filters
run: yarn regolith-install
- name: Build the addon
run: yarn build
- name: Build the GameTest pack
run: yarn build:test
- name: Run GameTests
run: yarn dlx @bedrock-core/bds-runner@0.1.0 run --packs ./build/test/BP --tag example --expect-registered 1 --bds-version 1.26.51.1
- name: Enable pnpm through Corepack
run: corepack enable
- name: Install project dependencies
run: pnpm install --frozen-lockfile
- name: Install declared filters
run: pnpm regolith-install
- name: Build the addon
run: pnpm build
- name: Build the GameTest pack
run: pnpm build:test
- name: Run GameTests
run: pnpm dlx @bedrock-core/bds-runner@0.1.0 run --packs ./build/test/BP --tag example --expect-registered 1 --bds-version 1.26.51.1
Commit the lockfile generated by the CLI before this workflow runs. npm CI expects
package-lock.json, Yarn's immutable install expects yarn.lock, and pnpm's frozen install expects
pnpm-lock.yaml.
After the step completes, regolith is on PATH for every later step in the same job. The action
only registers resolvers: the project's regolith-install script installs the filters declared in
filterDefinitions. The template's core profile declares core and its six delegated stages.
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
regolith-version | string | latest | Regolith release to install, latest or an exact version such as 1.6.1 |
resolvers | string | — | Newline- or comma-separated resolver URLs, each appended with regolith config resolvers --append |
The binary for the runner's OS comes from the Regolith GitHub releases and is kept in the Actions tool cache, so repeat runs on the same version download nothing.
Testing the build
Pair it with bds-runner to run the addon's GameTests on a dedicated server in the same job:
- npm
- yarn
- pnpm
npx @bedrock-core/bds-runner@0.1.0 run --packs ./build/test/BP --tag example --expect-registered 1 --bds-version 1.26.51.1
yarn dlx @bedrock-core/bds-runner@0.1.0 run --packs ./build/test/BP --tag example --expect-registered 1 --bds-version 1.26.51.1
pnpm dlx @bedrock-core/bds-runner@0.1.0 run --packs ./build/test/BP --tag example --expect-registered 1 --bds-version 1.26.51.1
Only the behavior pack is passed to the dedicated server. Render packs are client-side and are not needed for GameTests.