From 316932920517490895d4da98ac803ee0bccb5cda Mon Sep 17 00:00:00 2001 From: mulhern Date: Mon, 4 Mar 2024 12:58:16 -0500 Subject: [PATCH] Update Makefile to verify dependency versions Signed-off-by: mulhern --- .github/workflows/ci.yml | 38 ++++++++++++++++++++++++++++++++++++-- Makefile | 21 +++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74594d3..cba2dce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,10 @@ -on: [push, pull_request] +--- +name: loopdev-3 ci -name: loopdev +# yamllint disable-line rule:truthy +on: + push: + pull_request: jobs: check: @@ -26,6 +30,7 @@ jobs: target: ${{ matrix.target }} override: true - name: Cross + # yamllint disable rule:line-length run: cargo install --git https://github.com/cross-rs/cross.git --rev bb3df1b cross - name: Run cargo check @@ -61,3 +66,32 @@ jobs: - name: Run cargo clippy run: make -f Makefile clippy + + dependencies: + runs-on: ubuntu-latest + container: + image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT + steps: + - uses: actions/checkout@v4 + - name: Install dependencies for Fedora + run: > + dnf install -y + curl + git + make + openssl-devel + python-requests + python-semantic_version + - uses: dtolnay/rust-toolchain@master + with: + components: cargo + toolchain: 1.76.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN + - name: Check out ci repo + run: git clone https://github.com/stratis-storage/ci.git + - name: Run comparisons of version specs with available Fedora packages + # yamllint disable rule:line-length + run: | + COMPARE_FEDORA_VERSIONS=./compare_fedora_versions MANIFEST_PATH=../../Cargo.toml FEDORA_RELEASE=rawhide IGNORE_ARGS="--ignore-category low" make -f ../../Makefile check-fedora-versions + COMPARE_FEDORA_VERSIONS=./compare_fedora_versions MANIFEST_PATH=../../Cargo.toml FEDORA_RELEASE=f39 IGNORE_ARGS="--ignore-category low" make -f ../../Makefile check-fedora-versions + COMPARE_FEDORA_VERSIONS=./compare_fedora_versions MANIFEST_PATH=../../Cargo.toml FEDORA_RELEASE=f38 IGNORE_ARGS="--ignore-category low" make -f ../../Makefile check-fedora-versions + working-directory: ./ci/dependency_management diff --git a/Makefile b/Makefile index a902b16..40582e4 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,13 @@ +ifeq ($(origin FEDORA_RELEASE), undefined) +else + FEDORA_RELEASE_ARGS = --release=${FEDORA_RELEASE} +endif + +ifeq ($(origin MANIFEST_PATH), undefined) +else + MANIFEST_PATH_ARGS = --manifest-path=${MANIFEST_PATH} +endif + ifeq ($(origin CLIPPY_FIX), undefined) CLIPPY_OPTS = --all-targets --no-deps else @@ -10,3 +20,14 @@ CLIPPY_DENY = -D clippy::all -D clippy::cargo -A clippy::multiple-crate-versions clippy: RUSTFLAGS="${DENY}" cargo clippy ${CLIPPY_OPTS} -- ${CLIPPY_DENY} + +COMPARE_FEDORA_VERSIONS ?= +test-compare-fedora-versions: + echo "Testing that COMPARE_FEDORA_VERSIONS environment variable is set to a valid path" + test -e "${COMPARE_FEDORA_VERSIONS}" + +check-fedora-versions: test-compare-fedora-versions + ${COMPARE_FEDORA_VERSIONS} ${MANIFEST_PATH_ARGS} ${FEDORA_RELEASE_ARGS} ${IGNORE_ARGS} + +yamllint: + yamllint --strict .github/workflows/*.yml