Skip to content

CI/CD: GitHub Actions

Run your test suite in GitHub Actions and have results land in Sulu.

Minimal example

yaml
name: Tests

on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: 21
      - name: Run tests
        env:
          SULU_TOKEN: ${{ secrets.SULU_TOKEN }}
        run: ./gradlew test

Token storage

Add the project's API token as a repository secret named SULU_TOKEN. Reference it in the workflow as ${{ secrets.SULU_TOKEN }}.

Linking the launch back to the run

Pass the GitHub Actions run URL to the SDK as ciBuildUrl in sulu.properties:

properties
sulu.ci.build.url=${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}

The launch's detail page surfaces this URL as a "View CI run" link.

Per-PR launches

To create one launch per pull request, set the launch name to the PR title or branch name:

properties
sulu.launch.name=${env.GITHUB_HEAD_REF}

Sulu Test Management System