# Preview build artifacts and metrics with Stoat

- Channel: [Stoat](https://www.youtube.com/channel/UCt6hzSkvDcX1PZT57zARQyw)
- Published: 2023-05-01
- Source video: [Watch on YouTube](https://youtube.com/watch?v=oikep47_7ro)
- Read on ReadTube: https://www.read.tube/p/videos/oikep47_7ro
- Language: English

## Summary

**Stoat Previews Build Artifacts**

The video shows how Stoat can collect build artifacts and metrics from a GitHub Actions pipeline and surface them directly in pull request comments for easy access. After a simple setup, it adds job runtime charts plus preview links for artifacts like test coverage reports, Storybook, and Cypress video recordings, instead of leaving them buried in logs or discarded by the pipeline. It also explains that the comments update automatically with each new workflow run, making build data much easier to review over time.

Stoat is introduced as a way to collect, process, and present build artifacts and metrics that are usually scattered across CI tools and hard to inspect. Instead of manually wiring up separate viewers for each output, it can automatically integrate with GitHub Actions, report job runtimes, and keep a live summary attached to a pull request.

The setup is presented as simple: install the app, install the CLI, and run initialization in the project to detect workflows and add the Stoat action plus a global config. Once enabled, each new build updates a PR comment with runtime charts and, after adding preview tasks, a static hosting table for artifacts like coverage reports, Storybook previews, and Cypress videos. The main conclusion is that Stoat centralizes build outputs and makes CI results easy to access without leaving GitHub.

## Article

### Building a single place for build artifacts and metrics

Hello everyone, this is Kiran, co-founder of Still Dev. Every build can generate lots of data, including build artifacts and metrics like test coverage reports, documentation previews, and more. There are specific tools that can handle certain types of build data, but to use them, developers need to set them up individually.

In this video, we are going to introduce our platform, Still, that can ingest, process, and aggregate all kinds of build artifacts and metrics, and present them for easy access.

### A simple JavaScript project with tests and Storybook previews

Here we have a simple JavaScript project. This project has a continuous integration pipeline that runs unit tests and integration tests. It also generates Storybook previews.

We can go to the GitHub Actions logs to see a summary of the test reports, but there is no easy way to dig into the details. The Storybook preview is simply discarded from the pipeline.

Let's make the test reports and Storybook previews easy to access with Still.

### Setting up Still in three steps

We can set up Still in three steps.

#### Step 1: Install the Still application

First of all, install the Still application for this project.

#### Step 2: Install the Still command-line tool

Next, install the Still command-line tool.

#### Step 3: Initialize Still in the project root

Then, under the project root, run `still init`.

This command will automatically detect all existing GitHub workflows and set up the integration. We can either add it for all workflows or specific ones. Here, I am going to install it for all, since there is only one workflow.

The initialization does two things:

1. It appends a Still action at the end of the workflow.
2. It also creates a global Still config file.

The initial config will enable job runtime reporting.

### Opening a pull request and seeing runtime metrics

Let's create a branch, commit the change, and create a pull request on GitHub.

When the GitHub Action completes, you can see a chart for the job runtime in a comments pane at the top of the pull request. This comment is maintained by the Still application. It will be automatically updated with every GitHub workflow run.

Currently, there is only one chart and one data point. It will be more interesting after a few builds with small data points.

### Adding previews for all build artifacts

Now let's add previews for all build artifacts generated by the workflow. To do that, we can simply activate the static hosting plugin and add three preview tasks.

The three tasks correspond to three types of build artifacts generated in this pipeline:

- a test coverage report
- a preview of the Storybook
- a Cypress video preview

Each task has a path that tells the Still action where the artifact is generated.

### Watching Still update the pull request comment

Now let's commit the change and see how Still will update the comment as the new GitHub workflow run completes.

We can see this static hosting table pop up in the comments, listing all the build artifacts for preview:

- Here is the Storybook.
- Here is a Cypress video.
- And here is the test coverage report.

A new data point also showed up in the job runtime, denoting the latest GitHub run.

### What Still can do next

That's it. Hope that this video is useful to you.

Still can actually do much more. To find out the details, go to `still.dev` and check out our documentation.

Thank you for watching.
