Skip to main content
In this guide, you’ll learn how to configure a GitLab CI/CD job that uploads your test reports (test-results.xml) to an S3-compatible object store (AWS S3 or MinIO). We’ll define a reusable local template and then include it in our pipeline.

1. Review Existing Test Jobs

In the Solar System repository, two jobs already generate test artifacts:
We want to pick up test-results.xml from the unit_testing job and push it into our S3-compatible bucket.

2. Set Up MinIO

MinIO is an open-source, high-performance object storage compatible with AWS S3 APIs. After installing and starting MinIO:
  • Sign in at the browser UI
    Username: minioadmin
    Password: minioadmin
  • Create a bucket named solar-system-reports-bucket:
The image shows a MinIO Object Store interface where a user is creating a new bucket named "solar-system-reports-bu" with options for versioning, object locking, and quota.
Once the bucket exists, it’s initially empty:
The image shows a MinIO Object Store interface with a bucket named "solar-system-reports-bucket," which currently has 0 objects and 0.0B usage.
Keep your MinIO credentials (minioadmin:minioadmin) and endpoint (https://<MINIO_SERVER_API>:<PORT>) secure. Consider using GitLab CI/CD variables.

3. Create a Local Template

We’ll define a reusable job in templates/aws-reports.yml. Open your Web IDE, create the templates/ folder, and add:
The image shows a GitLab repository interface with a list of files and folders, along with options for editing and viewing commit history. A tooltip is visible, providing options for using Web IDE, Gitpod, and workspaces.
Replace MINIO_URL with your actual MinIO endpoint (including port).
Use protected CI/CD variables for credentials.

4. Integrate the Template in .gitlab-ci.yml

Include and invoke the template in your main CI file:

Pipeline Stages

If you’re using self-managed runners, ensure the tags (docker, linux, aws) match your runner configuration, or enable untagged jobs.

5. Verify Your Runners

Confirm that your group-level or project runner is online and tagged correctly:
The image shows a GitLab interface displaying a list of runners, with details such as status, version, and tags like "docker" and "aws." There are two runners listed, both online and idle, with options to edit or remove them.

6. Execute the Pipeline

Trigger a pipeline on main or any feature/* branch. If tags or permissions are misconfigured, jobs may stay pending.
The image shows a GitLab CI/CD pipeline dashboard with various pipeline statuses such as "Pending," "Skipped," "Warning," and "Passed."
Once everything is set up correctly, both unit_testing and reporting will pass:
The image shows a GitLab CI/CD pipeline interface for a NodeJS project named "Solar System," with two jobs, "unit_testing" and "reporting," both marked as passed.

Sample Job Logs

The image shows a GitLab CI/CD pipeline job interface, displaying the logs of a successful reporting job, including AWS CLI commands.

7. Verify in the MinIO Console

Open the MinIO browser again—you should now see the reports-<pipeline_id>/test-results.xml folder and file:
The image shows a MinIO Object Store interface with a bucket named "solar-system-reports-bucket," containing a reports folder and its contents.

8. Runner Configuration Interface

Need to update tags, timeouts, or other settings? Visit your runner’s edit page:
The image shows a GitLab interface for editing a runner configuration, including tags and optional settings like runner description and job timeout.

You now have a reusable local template that automates uploading GitLab CI test reports to any S3-compatible storage.

Watch Video

Practice Lab