Skip to content

Merge pull request #1241 from mulkieran/issue_stratis-cli_814 #2216

Merge pull request #1241 from mulkieran/issue_stratis-cli_814

Merge pull request #1241 from mulkieran/issue_stratis-cli_814 #2216

Workflow file for this run

---
name: stratis-cli CI
# yamllint disable-line rule:truthy
on:
push:
branches:
- master
paths-ignore:
- 'CHANGES.txt'
- '**/README.rst'
- 'LICENSE'
- 'docs/**'
- '.packit.yaml'
pull_request:
branches:
- master
paths-ignore:
- 'CHANGES.txt'
- '**/README.rst'
- 'LICENSE'
- 'docs/**'
- '.packit.yaml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
python-checks:
strategy:
matrix:
include:
# MANDATORY CHECKS USING CURRENT DEVELOPMENT INTERPRETER
- dependencies: >
bandit
libatomic
monkeytype
pylint
python3-dateutil
python3-dbus-client-gen
python3-dbus-python-client-gen
python3-justbytes
python3-packaging
python3-psutil
python3-wcwidth
task: >
PATH=${PATH}:/github/home/.local/bin PYTHONPATH=./src
make -f Makefile lint
- dependencies: black python3-isort
task:
PATH=${PATH}:/github/home/.local/bin PYTHONPATH=./src
make -f Makefile fmt-ci
runs-on: ubuntu-latest
container: fedora:42 # CURRENT DEVELOPMENT ENVIRONMENT
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- name: Install dependencies
run: >
dnf install -y
make
pip
python-unversioned-command
${{ matrix.dependencies }}
- name: Display Python version
run: python --version
- name: Install pyright
run: pip install --user pyright
- name: Install abs2rel
run: pip install --user abs2rel
- name: Run test
run: ${{ matrix.task }}
check-typos:
runs-on: ubuntu-latest
container: fedora:42 # CURRENT DEVELOPMENT ENVIRONMENT
steps:
- name: Install dependencies
run: >
dnf install -y
clang
glibc-static
make
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
components: cargo
toolchain: 1.91.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
- uses: baptiste0928/cargo-install@v3
with:
crate: typos-cli
- name: Run test
run: make -f Makefile check-typos
test-runs:
strategy:
matrix:
include:
- python: "3.13" # CURRENT DEVELOPMENT PYTHON TOOLCHAIN
- python: "3.12" # LOWEST SUPPORTED PYTHON TOOLCHAIN
runs-on: ubuntu-latest
container:
image: fedora:42 # CURRENT DEVELOPMENT ENVIRONMENT
# yamllint disable rule:line-length
options: --privileged --userns=host --ipc=host -v /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro -v /usr/share/dbus-1:/usr/share/dbus-1
steps:
- uses: dtolnay/rust-toolchain@master
with:
components: cargo
toolchain: 1.77.0 # LOWEST SUPPORTED RUST TOOLCHAIN
- name: Install python prerequisites
run: >
dnf install -y
alternatives
python${{ matrix.python }}
- name: Set python3 to python${{ matrix.python }}
run: >
alternatives
--install /usr/bin/python3
python3
/usr/bin/python${{ matrix.python }}
10
- name: Display Python version
run: python3 --version
- uses: actions/checkout@v5
with:
path: stratis-cli
persist-credentials: false
- name: Install dependencies
run: >
dnf install -y
asciidoc
clang
cryptsetup-devel
device-mapper-devel
dbus-devel
git
glibc-static
libblkid-devel
make
python3-dbus-client-gen
python3-dbus-python-client-gen
python3-justbytes
python3-dateutil
python3-packaging
python3-psutil
python3-wcwidth
systemd-devel
- uses: stratis-storage/github-actions/github-modify@HEAD
with:
repo: stratisd
- name: Print head commit
run: git log --oneline -1
working-directory: stratisd
- name: Overwrite stratisd dependencies as necessary
uses: stratis-storage/github-actions/stratisd-modify@HEAD
with:
working-directory: stratisd
- name: Build stratisd
run: PROFILEDIR=debug make build-all
working-directory: stratisd
- name: Install stratisd
run: PROFILEDIR=debug make install
working-directory: stratisd
- name: Workaround for D-Bus inotify
run: cp stratisd.conf /usr/share/dbus-1/system.d
working-directory: stratisd
- name: Run test
run: >
RUST_LOG=stratisd=debug
STRATISD=/usr/libexec/stratisd
STRATIS_STRICT_POOL_FEATURES=1
PYTHONPATH=./src
make -f Makefile all-tests
working-directory: stratis-cli
coverage-runs:
needs: test-runs
runs-on: ubuntu-latest
container:
image: fedora:42 # CURRENT DEVELOPMENT ENVIRONMENT
# yamllint disable rule:line-length
options: --privileged --userns=host --ipc=host -v /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro -v /usr/share/dbus-1:/usr/share/dbus-1
steps:
- uses: actions/checkout@v5
with:
path: stratis-cli
persist-credentials: false
- name: Install dependencies
run: >
dnf install -y
asciidoc
clang
cryptsetup-devel
device-mapper-devel
dbus-devel
git
glibc-static
libblkid-devel
make
python3-coverage
python3-dbus-client-gen
python3-dbus-python-client-gen
python3-justbytes
python3-dateutil
python3-packaging
python3-psutil
python3-wcwidth
systemd-devel
- uses: dtolnay/rust-toolchain@master
with:
components: cargo
toolchain: 1.77.0 # LOWEST SUPPORTED RUST TOOLCHAIN
- uses: stratis-storage/github-actions/github-modify@HEAD
with:
repo: stratisd
- name: Print head commit
run: git log --oneline -1
working-directory: stratisd
- name: Overwrite stratisd dependencies as necessary
uses: stratis-storage/github-actions/stratisd-modify@HEAD
with:
working-directory: stratisd
- name: Build stratisd
run: PROFILEDIR=debug make build-all
working-directory: stratisd
- name: Install stratisd
run: PROFILEDIR=debug make install
working-directory: stratisd
- name: Workaround for D-Bus inotify
run: cp stratisd.conf /usr/share/dbus-1/system.d
working-directory: stratisd
- name: Run tests
run: >
STRATISD=/usr/libexec/stratisd
STRATIS_STRICT_POOL_FEATURES=1
PYTHONPATH=./src
make -f Makefile coverage
working-directory: stratis-cli
- name: Run tests without strict pool features enabled
run: >
STRATISD=/usr/libexec/stratisd
PYTHONPATH=./src
make -f Makefile coverage
working-directory: stratis-cli
- name: Run coverage report
run: make -f Makefile coverage-report
working-directory: stratis-cli