Skip to content

ci(docs): Workaround ReadTheDocs SVG image failure #590

ci(docs): Workaround ReadTheDocs SVG image failure

ci(docs): Workaround ReadTheDocs SVG image failure #590

Workflow file for this run

# SPDX-FileCopyrightText: 2023 Ross Patterson <me@rpatterson.net>
#
# SPDX-License-Identifier: MIT
name: "Build and Test"
# TEMPLATE: If the project uses GitHub Actions, then add the following secrets to the
# project:
#
# - `CODECOV_TOKEN`:
# Add your project to https://app.codecov.io/gl and use the generated token
#
# - `DOCKER_PASS`:
# A Docker Hub Personal Access Token
#
# - `GPG_PASSPHRASE`:
# See the comments towards the bottom of the `./Makefile`
#
# - `GPG_SIGNING_PRIVATE_KEY`:
# See the comments towards the bottom of the `./Makefile`
#
# - `PROJECT_GITHUB_PAT`:
# A GitHub "Classic" Personal Access Token with scopes: `repo`, `workflow`,
# `packages`, and `project`
#
# - Add the project logo to the GitHub Social Preview:
# https://github.com/rpatterson/project-structure/settings
#
# Add them through the web UI or use the GitHub command-line tool:
# https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository
#
# You can also add the `ACTIONS_STEP_DEBUG` and `DEBUG` Actions variables and set them
# to `true` to increase debugging output.
env:
PUID: "1001"
PGID: "1001"
# Project specific values:
PROJECT_NAMESPACE: "rpatterson"
GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"
GPG_SIGNING_PRIVATE_KEY: "${{ secrets.GPG_SIGNING_PRIVATE_KEY }}"
DOCKER_PASS: "${{ secrets.DOCKER_PASS }}"
# Enable the GitHub command-line:
PROJECT_GITHUB_PAT: "${{ secrets.PROJECT_GITHUB_PAT }}"
# Tell the `./Makefile` about GitHub specific environment details:
CI_IS_FORK: >-
${{
(
(
(github.repository_owner != '${PROJECT_NAMESPACE}')
|| (github.event.pull_request.head.repo.owner.login != '${PROJECT_NAMESPACE}')
) && 'true'
) || 'false'
}}
DEBUG: "${{ vars.DEBUG }}"
on:
# Run only on branches, not tags:
# https://github.com/orgs/community/discussions/25615#discussioncomment-3397691
push:
branches:
- "**"
tags:
- "!**"
# Also run for open pull requests, including when pushed to:
pull_request: {}
jobs:
build-test-default:
runs-on: "ubuntu-latest"
container:
# TEMPLATE: Only change these if you customize the `./build-host/Dockerfile` image.
# Otherwise use the version of this image from the project template in your CI/CD.
image: "ghcr.io/rpatterson/project-structure:build-host"
env:
CHECKOUT_DIR: "${{ github.workspace }}"
permissions:
packages: "write"
checks: "write"
strategy:
matrix:
DOCKER_OSES:
- "debian"
DOCKER_LANGUAGES:
- ""
env:
DOCKER_OSES: "${{ matrix.DOCKER_OSES }}"
DOCKER_LANGUAGES: "${{ matrix.DOCKER_LANGUAGES }}"
steps:
# Shared or common set up:
- name: "Checkout source from VCS"
uses: "actions/checkout@master"
# TODO: Debug stale venv issues and restore cache after fixing.
# Delegate steps agnostic of the CI/CD platform to the `./Makefile`:
- name: "Build image and run tests and checks in a container"
run: >-
git config --global --add safe.directory
/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
&&
init-job.sh entrypoint.sh make -j -O release-all
# Upload build artifacts:
# https://github.com/actions/upload-artifact#usage
- name: "Archive test, coverage, and lint reports"
uses: "actions/upload-artifact@master"
with:
name: "test-coverage-lint-reports"
path: |
./build/reports/
# TEMPLATE: Write coverage results in Cobertura XML format to
# `./build/coverage.xml` in the project root and un-comment:
# https://github.com/marketplace/actions/test-reporter#example
# - name: "Publish test suite report"
# uses: "dorny/test-reporter@main"
# # run this step even if preceding step failed
# if: >-
# (success() || failure())
# && (
# (! github.event.pull_request)
# || ! (
# (github.repository_owner == '${PROJECT_NAMESPACE}')
# && (
# github.event.pull_request.head.repo.owner.login
# != '${PROJECT_NAMESPACE}'
# )
# )
# )
# with:
# name: >-
# Test Suite Reports
# (${{ matrix.DOCKER_VARIANT_OSES }}-${{ matrix.DOCKER_VARIANT_LANGUAGES }})
# path: >-
# ./build/reports/*/*unit.xml
# reporter: "java-junit"
build-test-others:
needs: ["build-test-default"]
runs-on: "ubuntu-latest"
container:
# TEMPLATE: Only change these if you customize the `./build-host/Dockerfile` image.
# Otherwise use the version of this image from the project template in your CI/CD.
image: "ghcr.io/rpatterson/project-structure:build-host"
env:
CHECKOUT_DIR: "${{ github.workspace }}"
permissions:
packages: "write"
checks: "write"
# TEMPLATE: Add values for image variants other than the default:
strategy:
matrix:
DOCKER_OSES:
- "debian"
DOCKER_LANGUAGES:
- ""
env:
DOCKER_OSES: "${{ matrix.DOCKER_OSES }}"
DOCKER_LANGUAGES: "${{ matrix.DOCKER_LANGUAGES }}"
steps:
# Shared or common set up:
- name: "Checkout source from VCS"
uses: "actions/checkout@master"
# TODO: Debug stale venv issues and restore cache after fixing.
# Delegate steps agnostic of the CI/CD platform to the `./Makefile`:
- name: "Build image and run tests and checks in a container"
run: >-
git config --global --add safe.directory
/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}
&&
init-job.sh entrypoint.sh make -j -O release-all
# Upload build artifacts:
# https://github.com/actions/upload-artifact#usage
- name: "Archive test, coverage, and lint reports"
uses: "actions/upload-artifact@master"
with:
name: "\
test-coverage-lint-reports\
-${{ matrix.DOCKER_OSES }}-${{ matrix.DOCKER_LANGUAGES }}"
path: |
./build/reports/
# - name: "Publish test suite report"
# uses: "dorny/test-reporter@main"
# # run this step even if preceding step failed
# if: >-
# (success() || failure())
# && (
# (! github.event.pull_request)
# || ! (
# (github.repository_owner == '${PROJECT_NAMESPACE}')
# && (
# github.event.pull_request.head.repo.owner.login
# != '${PROJECT_NAMESPACE}'
# )
# )
# )
# with:
# name: >-
# Test Suite Reports (${{ matrix.DOCKER_VARIANT }})
# path: >-
# ./build/reports/*/*unit.xml
# reporter: "java-junit"