---
name: stratisd CI
on:
push:
branches:
- master
- develop-2.4.1
paths-ignore:
- 'CHANGES.txt'
- '**/README.md'
pull_request:
branches:
- master
- develop-2.4.1
paths-ignore:
- 'CHANGES.txt'
- '**/README.md'
workflow_dispatch:
jobs:
checks:
strategy:
matrix:
include:
- task: make -f Makefile fmt-travis
toolchain: 1.52.1
components: rustfmt
image: ubuntu:groovy
- task: make -f Makefile clippy
toolchain: 1.52.1
components: clippy
image: ubuntu:groovy
- task: make -f Makefile fmt-travis
toolchain: 1.52.1
components: rustfmt
image: fedora:33
- task: make -f Makefile clippy
toolchain: 1.52.1
components: clippy
image: fedora:33
- task: make -f Makefile build
toolchain: stable
components: cargo
image: ubuntu:groovy
- task: make -f Makefile build-min
toolchain: stable
components: cargo
image: ubuntu:groovy
- task: make -f Makefile build-extras
toolchain: stable
components: cargo
image: ubuntu:groovy
- task: make -f Makefile docs-travis
toolchain: stable
components: cargo
image: ubuntu:groovy
- task: make -f Makefile test
toolchain: stable
components: cargo
image: ubuntu:groovy
- task: make -f Makefile release
toolchain: stable
components: cargo
image: ubuntu:groovy
- task: make -f Makefile release-min
toolchain: stable
components: cargo
image: ubuntu:groovy
- task: make -f Makefile build
toolchain: stable
components: cargo
image: fedora:33
- task: make -f Makefile build-min
toolchain: stable
components: cargo
image: fedora:33
- task: make -f Makefile build-extras
toolchain: stable
components: cargo
image: fedora:33
- task: make -f Makefile docs-travis
toolchain: stable
components: cargo
image: fedora:33
- task: make -f Makefile test
toolchain: stable
components: cargo
image: fedora:33
- task: make -f Makefile release
toolchain: stable
components: cargo
image: fedora:33
- task: make -f Makefile release-min
toolchain: stable
components: cargo
image: fedora:33
runs-on: ubuntu-18.04
container:
image: ${{ matrix.image }}
options: --privileged -v /dev:/dev
steps:
- uses: actions/checkout@v2
- name: Install dependencies for Ubuntu
run: apt-get -q update
if: matrix.image == 'ubuntu:groovy'
- name: Install dependencies for Ubuntu
run: >
DEBIAN_FRONTEND=noninteractive
apt-get install -y
clang
curl
libblkid-dev
libcryptsetup-dev
libdbus-1-dev
libsystemd-dev
libudev-dev
make
if: matrix.image == 'ubuntu:groovy'
- name: Install dependencies for Fedora
run: >
dnf install -y
clang
curl
cryptsetup-devel
dbus-devel
libblkid-devel
make
systemd-devel
if: matrix.image == 'fedora:33'
- uses: actions-rs/toolchain@v1
with:
components: ${{ matrix.components }}
toolchain: ${{ matrix.toolchain }}
override: true
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
run: ${{ matrix.task }}
checks_with_udev:
strategy:
matrix:
include:
- task: RUST_LOG=libstratis=debug make -f Makefile test-loop
toolchain: stable
components: cargo
image: ubuntu:groovy
- task: RUST_LOG=libstratis=debug make -f Makefile test-loop
toolchain: stable
components: cargo
image: fedora:33
runs-on: ubuntu-18.04
container:
image: ${{ matrix.image }}
options: --privileged -v /dev:/dev
steps:
- uses: actions/checkout@v2
- name: Install dependencies for Ubuntu
run: apt-get -q update
if: matrix.image == 'ubuntu:groovy'
- name: Install dependencies for Ubuntu
run: >
DEBIAN_FRONTEND=noninteractive
apt-get install -y
asciidoc
clang
curl
libblkid-dev
libcryptsetup-dev
libdbus-1-dev
libsystemd-dev
libudev-dev
make
systemd
thin-provisioning-tools
udev
xfsprogs
if: matrix.image == 'ubuntu:groovy'
- name: Install dependencies for Fedora
run: >
dnf install -y
asciidoc
clang
cryptsetup-devel
curl
device-mapper-persistent-data
dbus-devel
libblkid-devel
make
systemd-devel
systemd-udev
xfsprogs
if: matrix.image == 'fedora:33'
- uses: actions-rs/toolchain@v1
with:
components: ${{ matrix.components }}
toolchain: ${{ matrix.toolchain }}
override: true
- name: Install all necessary Stratis files
run: make install
- name: Start udev
run: /usr/lib/systemd/systemd-udevd &
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
run: ${{ matrix.task }}
checks_with_tang:
strategy:
matrix:
include:
- task: >-
TANG_URL=tang
RUST_LOG=libstratis=debug
make -f Makefile test-clevis-loop
toolchain: stable
components: cargo
image: fedora:33
runs-on: ubuntu-18.04
container:
image: ${{ matrix.image }}
options: --privileged -v /dev:/dev
services:
tang:
image: docker.pkg.github.com/stratis-storage/stratisd/tang:32
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged -p 80:80
steps:
- uses: actions/checkout@v2
- name: Install dependencies for Fedora
run: >
dnf install -y
clang
cryptsetup-devel
clevis
clevis-luks
curl
device-mapper-persistent-data
dbus-devel
libblkid-devel
make
systemd-devel
systemd-udev
xfsprogs
- name: Start udev
run: /usr/lib/systemd/systemd-udevd &
- uses: actions-rs/toolchain@v1
with:
components: ${{ matrix.components }}
toolchain: ${{ matrix.toolchain }}
override: true
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
run: ${{ matrix.task }}
python-checks:
strategy:
matrix:
include:
- dependencies: >
pylint
python3-dbus-client-gen
python3-dbus-python-client-gen
python3-psutil
python3-pyudev
python3-requests
python3-semantic_version
python3-pygithub
image: fedora:33
task: >
(cd code_maintenance; make -f Makefile lint) &&
(cd tests/client-dbus; PYTHONPATH=./src make -f Makefile lint)
- dependencies: black python3-isort
image: fedora:33
task: >
(cd code_maintenance; make -f Makefile fmt-travis) &&
(cd tests/client-dbus; make -f Makefile fmt-travis)
- dependencies: yamllint
image: fedora:33
task: make -f Makefile yamllint
runs-on: ubuntu-18.04
container: ${{ matrix.image }}
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: >
dnf install -y
make
python-unversioned-command
${{ matrix.dependencies }}
- name: Display Python version
run: python --version
- name: Run test
run: ${{ matrix.task }}
stratis-cli-checks:
runs-on: ubuntu-18.04
container: fedora:30 steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: >
dnf install -y
asciidoc
clang
cryptsetup-devel
dbus-daemon
dbus-tools
dbus-devel
libblkid-devel
git
make
python3-coverage
python3-dbus-client-gen
python3-dbus-python-client-gen
python3-justbytes
python3-dateutil
python3-psutil
python3-semantic_version
systemd-devel
- uses: actions-rs/toolchain@v1
with:
components: cargo
toolchain: 1.49.0 override: true
- name: Build stratisd
run: PROFILEDIR=debug make -f Makefile install
- name: Check out stratis-cli
run: git clone https://github.com/stratis-storage/stratis-cli.git
- name: Set up for D-Bus
run: |
mkdir -p /var/lib/dbus
dbus-uuidgen > /var/lib/dbus/machine-id
mkdir -p /var/run/dbus
- name: Start D-Bus
run: >
dbus-daemon
--config-file=/usr/share/dbus-1/system.conf
--print-address
- name: Run stratis-cli tests
run: >
RUST_LOG=libstratis=debug,stratisd=debug
STRATISD=/usr/libexec/stratisd
PYTHONPATH=./src
make dbus-tests
working-directory: ./stratis-cli
python-based-tests:
strategy:
matrix:
include:
- image: fedora:33
toolchain: 1.52.1 - image: fedora:30
toolchain: 1.49.0 runs-on: ubuntu-18.04
container:
image: ${{ matrix.image }}
options: --privileged -v /dev:/dev
steps:
- uses: actions/checkout@v2
- name: Install dependencies for Fedora
run: >
dnf install -y
asciidoc
clang
cryptsetup-devel
curl
dbus-daemon
dbus-devel
dbus-tools
device-mapper-persistent-data
libblkid-devel
make
python3-dbus
python3-dbus-client-gen
python3-dbus-python-client-gen
python3-psutil
python3-pyudev
systemd-devel
systemd-udev
xfsprogs
- uses: actions-rs/toolchain@v1
with:
components: cargo
toolchain: ${{ matrix.toolchain }}
override: true
- name: Install all necessary Stratis files
run: PROFILEDIR=debug make -f Makefile install
- name: Start udev
run: /usr/lib/systemd/systemd-udevd &
- name: Set up for D-Bus
run: |
mkdir -p /var/lib/dbus
dbus-uuidgen > /var/lib/dbus/machine-id
mkdir -p /var/run/dbus
- name: Start D-Bus
run: >
dbus-daemon
--config-file=/usr/share/dbus-1/system.conf
--print-address
- name: Tests on ${{ matrix.image }} using Rust ${{ matrix.toolchain }}
run: >
RUST_LOG=libstratis=debug,stratisd=debug
STRATISD=/usr/libexec/stratisd
STRATIS_PREDICT_USAGE=/usr/bin/stratis-predict-usage
PYTHONPATH=./src
make udev-tests
working-directory: ./tests/client-dbus