A GitHub Action that runs a MooseCI analysis on your project. It writes a report and uploads it as a GitHub Actions artifact.
name: MooseCI
on: [push, pull_request]
permissions:
contents: read
actions: write
pull-requests: write
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: moosetechnology/setup-MooseCI@v1
with:
project-language: javaThe actions: write permission is needed to upload the report artifact. The pull-requests: write permission is needed to comment the report link on pull requests.
A complete workflow example from this unofficial tslearn pull request:
name: Moose CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: moosetechnology/setup-MooseCI@v1
with:
project-path: tslearn
project-language: pythonproject-path: the folder to analyze, relative to the workspace. Default:.project-language(required): language of the project to analyze. It selects the Docker image:javausesghcr.io/moosetechnology/moose-ci:<version>(the base image, which includes Java),pythonusesghcr.io/moosetechnology/moose-ci:<version>-python.mooseci-version: version of the MooseCI Docker images to use. Default:v0.1.0comment-on-pr: comment the report artifact link on pull requests. Default:true
Your project needs a moose-ci.ston config file placed inside the project folder. You can create it by running the init command from inside the project folder:
cd <project-path>
docker run -v "$PWD:/src" ghcr.io/moosetechnology/moose-ci:latest initThe project language must be supported by MooseCI:
- Python
- Java (wip)
The action runs MooseCI in a Docker container. It mounts your project folder inside the container at /src. MooseCI analyzes the current working directory and writes the report. The action then uploads the report files as an artifact named moose-ci-report.
The report files (named report-*.json) are uploaded as a single artifact called moose-ci-report. You can download it from the workflow run.
By default, the action comments on pull requests with:
- the report download URL
- the analysis summary (metrics and quality results)
The action posts one comment per language: it uses project-language as the comment identifier, so a Java and a Python run each get their own comment. On every push, the comment is updated in place with the latest report.
You can turn this off with comment-on-pr: false. The comment step never fails the workflow.
