Skip to content

Merge pull request #1283 from mulkieran/cancel-outdated-test-runs #2443

Merge pull request #1283 from mulkieran/cancel-outdated-test-runs

Merge pull request #1283 from mulkieran/cancel-outdated-test-runs #2443

Workflow file for this run

---
name: stratis-cli CI
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'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
python-checks:
strategy:
matrix:
include:
# MANDATORY CHECKS USING CURRENT DEVELOPMENT INTERPRETER
- dependencies: >
libatomic
python3-dateutil
python3-dbus-client-gen
python3-dbus-python-client-gen
python3-justbytes
python3-packaging
python3-psutil
python3-setuptools
python3-wcwidth
ruff
task: PATH=${PATH}:/github/home/.local/bin make -f Makefile lint
- dependencies: ruff
task: PATH=${PATH}:/github/home/.local/bin make -f Makefile fmt-ci
runs-on: ubuntu-latest
container:
image: quay.io/fedora/fedora:43 # CURRENT DEVELOPMENT ENVIRONMENT
steps:
- uses: actions/checkout@v6
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: Run test
run: ${{ matrix.task }}
check-typos:
runs-on: ubuntu-latest
container:
image: quay.io/fedora/fedora:43 # CURRENT DEVELOPMENT ENVIRONMENT
steps:
- name: Install dependencies
run: >
dnf install -y
clang
glibc-static
make
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
- 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.14" # CURRENT DEVELOPMENT PYTHON TOOLCHAIN
- python: "3.12" # LOWEST SUPPORTED PYTHON TOOLCHAIN
runs-on: ubuntu-latest
container:
image: quay.io/fedora/fedora:43 # CURRENT DEVELOPMENT ENVIRONMENT
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:
- 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@v6
with:
path: stratis-cli
persist-credentials: false
- name: Install dependencies
run: >
dnf install -y
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
toml-cli
- uses: stratis-storage/github-actions/github-modify@HEAD
with:
repo: stratisd
- name: Print head commit
run: git log --oneline -1
working-directory: stratisd
- name: Get package MSRV
id: msrv
run: |
MSRV=$(toml get --toml-path Cargo.toml "workspace.package.rust-version")
echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
working-directory: stratisd
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
toolchain: ${{ steps.msrv.outputs.MSRV }}
- 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-rust
working-directory: stratisd
- name: Install stratisd
run: PROFILEDIR=debug make install-programs
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: quay.io/fedora/fedora:43 # CURRENT DEVELOPMENT ENVIRONMENT
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@v6
with:
path: stratis-cli
persist-credentials: false
- name: Install dependencies
run: >
dnf install -y
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
toml-cli
- uses: stratis-storage/github-actions/github-modify@HEAD
with:
repo: stratisd
- name: Print head commit
run: git log --oneline -1
working-directory: stratisd
- name: Get package MSRV
id: msrv
run: |
MSRV=$(toml get --toml-path Cargo.toml "workspace.package.rust-version")
echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
working-directory: stratisd
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
toolchain: ${{ steps.msrv.outputs.MSRV }}
- 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-rust
working-directory: stratisd
- name: Install stratisd
run: PROFILEDIR=debug make install-programs
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