Skip to content

Examples

Examples #153

Workflow file for this run

name: Examples
on:
workflow_dispatch:
inputs:
root_target:
type: choice
description: Project to run
options:
- ''
# Launchpad has limited availability.
# - breezyshim
- cargo
- git
- gpsd
- libiconv
- mercurial-hello
- minimal
- nghttp2
- pacman
# Perforce disabled for now since anonymous cloning no longer works.
# - perforce-hms
- vulkan-samples
jobs:
build:
name: Build (${{ matrix.root_dir }}-${{ matrix.os }}-${{ matrix.python }})
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.img }}
strategy:
fail-fast: false
matrix:
include:
# minimal examples on each python interpreter
- { os: ubuntu-latest, img: "python:3.10", python: "3.10", root_dir: minimal, cache: ~/.cache/pip }
- { os: ubuntu-latest, img: "python:3.11", python: "3.11", root_dir: minimal, cache: ~/.cache/pip }
- { os: ubuntu-latest, img: "python:3.12", python: "3.12", root_dir: minimal, cache: ~/.cache/pip }
- { os: ubuntu-latest, img: "python:3.13", python: "3.13", root_dir: minimal, cache: ~/.cache/pip }
- { os: ubuntu-latest, img: "python:3.14", python: "3.14", root_dir: minimal, cache: ~/.cache/pip }
# minimal examples on additional operating systems
- { os: macos-latest, python: "3.12", root_dir: minimal, cache: ~/Library/Caches/pip }
- { os: windows-latest, python: "3.12", root_dir: minimal, cache: ~\AppData\Local\pip\Cache }
# breezyshim example
# - { os: ubuntu-latest, python: "3.13", root_dir: breezyshim, cache: ~/.cache/pip }
# cargo example
- { os: ubuntu-latest, python: "3.12", root_dir: cargo, cache: ~/.cache/pip }
# git example
- { os: ubuntu-latest, python: "3.12", root_dir: git, cache: ~/.cache/pip }
# gpsd example
- { os: ubuntu-latest, python: "3.12", root_dir: gpsd, cache: ~/.cache/pip }
# libiconv example
- { os: ubuntu-latest, python: "3.12", root_dir: libiconv, cache: ~/.cache/pip, action: extract }
# mercurial-hello example
- { os: ubuntu-latest, python: "3.12", root_dir: mercurial-hello, cache: ~/.cache/pip }
# pacman example
- { os: ubuntu-latest, python: "3.12", root_dir: pacman, cache: ~/.cache/pip }
# perforce-hms example
# - { os: ubuntu-latest, python: "3.12", root_dir: perforce-hms, cache: ~/.cache/pip }
# nghttp2 example
- { os: ubuntu-latest, python: "3.12", root_dir: nghttp2, cache: ~/.cache/pip }
# vulkan-samples example
- { os: ubuntu-latest, python: "3.12", root_dir: vulkan-samples, cache: ~/.cache/pip }
- { os: windows-latest, python: "3.12", root_dir: vulkan-samples, cache: ~\AppData\Local\pip\Cache }
steps:
- name: Check if matrix job is permitted
# If a specific project has been requested, only run for the requested root.
if: ${{ github.event.inputs.root_target != '' && github.event.inputs.root_target != matrix.root_dir }}
run: |
echo ${{ github.event.inputs.root_target }}
exit 1
- name: Checkout sources
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python }}
if: ${{ matrix.img == '' }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Cache pip
uses: actions/cache@v5
id: cache-pip
with:
path: |
${{ matrix.cache }}
$HOME/releng-tool-cache
$HOME/releng-tool-dl
key: ${{ matrix.os }}-${{ matrix.python }}-pip
- name: Setup container cache ownership
if: ${{ matrix.img != '' }}
run: |
mkdir -p ~/.cache
chown -R $(id -u) ~/.cache
# dependencies
- name: Install dependencies (Python)
run: >
python -m pip install --upgrade
installer
matplotlib
pip
setuptools
wheel
# dependencies (breezyshim)
- name: Install dependencies (breezyshim; ubuntu-latest)
run: >
sudo apt-get install
brz
if: matrix.os == 'ubuntu-latest' && matrix.root_dir == 'breezyshim'
- name: Install dependencies (breezyshim, cargo; ubuntu-latest)
uses: actions-rust-lang/setup-rust-toolchain@v1
if: matrix.os == 'ubuntu-latest' && matrix.root_dir == 'breezyshim'
# dependencies (cargo)
- name: Install dependencies (cargo; ubuntu-latest)
uses: actions-rust-lang/setup-rust-toolchain@v1
if: matrix.os == 'ubuntu-latest' && matrix.root_dir == 'cargo'
# dependencies (git)
- name: Install dependencies (git; ubuntu-latest)
run: >
sudo apt-get install
gettext
if: matrix.os == 'ubuntu-latest' && matrix.root_dir == 'git'
# dependencies (libiconv)
- name: Install dependencies (libiconv; ubuntu-latest)
run: >
sudo apt-get install
cvs
if: matrix.os == 'ubuntu-latest' && matrix.root_dir == 'libiconv'
# dependencies (mercurial-hello)
- name: Install dependencies (mercurial-hello; ubuntu-latest)
run: >
sudo apt-get install
mercurial
if: matrix.os == 'ubuntu-latest' && matrix.root_dir == 'mercurial-hello'
# dependencies (pacman)
- name: Install dependencies (pacman; ubuntu-latest).
# libarchive public key
# (use ubuntu ks to prevent "new key but contains no user ID - skipped")
run: |
gpg --keyserver hkps://keyserver.ubuntu.com \
--recv-keys DB2C7CF1B4C265FAEF56E3FC5848A18B8F14184B
sudo apt-get install ninja-build
python -m pip install --upgrade meson
if: matrix.os == 'ubuntu-latest' && matrix.root_dir == 'pacman'
# dependencies (perforce-hms)
- name: Install dependencies (perforce-hms; ubuntu-latest).
run: |
wget -qO - https://package.perforce.com/perforce.pubkey | sudo apt-key add -
printf "deb http://package.perforce.com/apt/ubuntu $(lsb_release -sc) release\n" | sudo tee /etc/apt/sources.list.d/perforce.list >/dev/null
sudo apt update && sudo apt install helix-cli
wget https://git.kernel.org/pub/scm/git/git.git/plain/git-p4.py?id=master -O git-p4 && chmod +x git-p4
sudo mv git-p4 /usr/lib/git-core/
if: matrix.os == 'ubuntu-latest' && matrix.root_dir == 'perforce-hms'
# dependencies (vulkan-samples)
- name: Install dependencies (vulkan-samples; ubuntu-latest)
run: >
sudo apt-get install
libwayland-dev
if: matrix.os == 'ubuntu-latest' && matrix.root_dir == 'vulkan-samples'
- name: Install releng-tool
run: python -m pip install git+https://github.com/releng-tool/releng-tool.git
- name: State information
run: |
python --version
env | sort
- name: Build test
run: >
releng-tool
--root-dir ${{ matrix.root_dir }}
--cache-dir $HOME/releng-tool-cache
--dl-dir $HOME/releng-tool-dl
--debug
${{ matrix.action }}
- name: Dump of output
run: |
find ${{ matrix.root_dir }}/output/target 2>/dev/null || true
find ${{ matrix.root_dir }}/output/images 2>/dev/null || true
if: matrix.os != 'windows-latest'
- name: Dump of output
run: |
Get-ChildItem ${{ matrix.root_dir }}/output/target -recurse | foreach fullname
Get-ChildItem ${{ matrix.root_dir }}/output/target -recurse | foreach fullname
if: matrix.os == 'windows-latest'
- name: Track SBOM information
uses: actions/upload-artifact@v6
with:
name: sbom-${{ matrix.root_dir }}-${{ matrix.os }}-${{ matrix.python }}
path: ${{ matrix.root_dir }}/output/sbom*
- name: Track duration information
uses: actions/upload-artifact@v6
with:
name: durations-${{ matrix.root_dir }}-${{ matrix.os }}-${{ matrix.python }}
path: ${{ matrix.root_dir }}/output/misc/durations*