Link Search Menu Expand Document

Github Actions: Workflow 02 - Rebuild content of gh-pages branch (part 1)

Workflow 02-gh-pages-rebuild-part-1.yml consists of three parts:

  • An introductory job called Build Basic Site
  • Six jobs that rebuild the gh-pages site for the main branch, and run in parallel
  • A matrix of six jobs that rebuild the gh-pages site for each PR, and also run in parallel

Here’s what that looks like when running with exactly one active PR. If there were multiple active PRs, the second set of six jobs would be repeated as many times as there are PRs:

image

Uploading Artifacts

The workflow actions/upload-artifact is used in various places to upload artifacts that are then downloaded and deployed to the gh-pages branch in the workflow 04-gh-pages-rebuild-part-2.yml.

Here’s an example:

    - name: Upload to artifacts
      uses: actions/upload-artifact@v4
      with:
          name: javadoc
          path: $
          overwrite: true

Here:

  • name is a key used for the key/value store used by Github Actions for artifacts
  • path is the location that the artifact should be retrieved from. When it is described by a variable $ it is because a previous step used that as the destination to store something (e.g. the generated javadoc, coverage report, etc.).
  • overwrite: true is needed because the actions/upload-artifact, by default, will not overwrite a previously uploaded artifact.

The names currently used in the script are:

job Artifact Name Explanation
a - Javadoc (main) javadoc Javadoc, HTML documentation
b - Chromatic (main) chromatic Storybook and Chromatic Build, HTML redirect to Chromatic.com
c - Jacoco (main) jacoco Test Coverage (java, backend), HTML report
d - Pitest (main) pitest Mutation testing (java, backend), HTML report
e - Coverage (main) coverage Test Coverage (javascript, frontend), HTML report
f - Stryker (main) stryker-incremental-main.json Mutation Test Coverage (javascript, frontend); data for incremental runs
f - Stryker (main) stryker Mutation Test Coverage (javascript, frontend); HTML report
a - Javadoc (PR, branch) prs-num-javadoc Javadoc, HTML documentation
b - Chromatic (PR, branch) prs-num-chromatic Storybook and Chromatic Build, HTML redirect to Chromatic.com
c - Jacoco (PR, branch) prs-num-jacoco Test Coverage (java, backend), HTML report
d - Pitest (PR, branch) prs-num-pitest Mutation testing (java, backend), HTML report
e - Coverage (PR, branch) prs-num-coverage Test Coverage (javascript, frontend), HTML report
f - Stryker (PR, branch) prs-num-stryker-incremental-main.json Mutation Test Coverage (javascript, frontend); data for incremental runs
f - Stryker (PR, branch) prs-num-stryker Mutation Test Coverage (javascript, frontend); HTML report