hotkdump/summary: convert summary output from plain text to html #133
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
jobs: | |
Test: | |
strategy: | |
matrix: | |
include: | |
# (mkg): github has deprecated ubuntu 18.04 | |
# runners and apparently started removing them | |
# too. so, we're running ubuntu:18.04 containers | |
# on top of ubuntu-20.04 to get test coverage in | |
# bionic too. The rest do not need this -- yet. | |
- os: ubuntu-20.04 | |
toxenv: py36 | |
vars: { aptpkg: python3.6, container: 'ubuntu:18.04' } | |
- os: ubuntu-20.04 | |
toxenv: py37 | |
vars: { aptpkg: python3.7, container: 'ubuntu:18.04' } | |
- os: ubuntu-20.04 | |
toxenv: py38 | |
vars: { aptpkg: python3.8, container: 'ubuntu:18.04' } | |
- os: ubuntu-20.04 | |
toxenv: py38 | |
vars: { aptpkg: python3.8 } | |
- os: ubuntu-20.04 | |
toxenv: py39 | |
vars: { aptpkg: python3.9 } | |
- os: ubuntu-22.04 | |
toxenv: py310 | |
vars: { aptpkg: python3.10 } | |
- os: ubuntu-22.04 | |
toxenv: py311 | |
vars: { aptpkg: python3.11 } | |
- os: ubuntu-24.04 | |
toxenv: py312 | |
vars: { aptpkg: python3.12, pipargs: --break-system-packages } | |
fail-fast: true | |
runs-on: ${{ matrix.os }} | |
env: | |
# (mkg): Github runners have switched to node20 which depends on GLIBC2.27. | |
# Bionic does not have that, so we have to use this workaround until it lasts. | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: ${{ matrix.vars.container == 'ubuntu:18.04' }} | |
container: ${{ matrix.vars.container }} # github actions will ignore this when unset | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: | | |
if [[ "$EUID" -ne 0 ]]; then | |
SUDO_CMD="sudo -H" | |
else | |
SUDO_CMD="" | |
fi | |
$SUDO_CMD apt -y update | |
$SUDO_CMD apt -y install git python3 python3-pip | |
$SUDO_CMD apt -y install ${{ matrix.vars.aptpkg }} | |
pip3 install tox ${{ matrix.vars.pipargs }} | |
shell: bash | |
- name: Run unit tests | |
run: | | |
echo "Environment" ${{ matrix.toxenv }} | |
tox -e "${{ matrix.toxenv }}" | |
- name: Run pylint | |
if: matrix.toxenv== 'py312' | |
run: | | |
tox -e pylint | |
- name: Run ruff-check | |
if: matrix.toxenv== 'py312' | |
run: | | |
tox -e ruff-check | |
- name: Run ruff-format-check | |
if: matrix.toxenv== 'py312' | |
run: | | |
tox -e ruff-format-check | |
Test-Snap: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: | | |
if [[ "$EUID" -ne 0 ]]; then | |
SUDO_CMD="sudo -H" | |
else | |
SUDO_CMD="" | |
fi | |
$SUDO_CMD apt -y update | |
$SUDO_CMD apt -y install snapcraft sudo | |
$SUDO_CMD snap refresh lxd --channel=latest/stable | |
- name: Initialize LXD | |
run: | | |
sudo lxd init --auto | |
sudo usermod -aG lxd $USER | |
whoami | |
groups | |
- name: Build the snap | |
run: | | |
sudo -s -u ${USER} bash -c 'whoami && groups && snapcraft' | |
- name: Install the snap | |
run: | | |
sudo snap install ./hotkdump*.snap --dangerous | |
- name: Test the hotkdump command | |
run: | | |
# (mkg): We had to do this because there's no good way | |
# (that I'm aware of) getting the exit code when process | |
# substition is used. | |
hotkdump 2> >(grep "usage" || echo "fail") | grep -v "fail" | |