Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo: update deps #251

Merged
merged 10 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 43 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
format:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: install stable toolchain with rustfmt
Expand All @@ -27,7 +27,7 @@ jobs:
args: -- --check

xen:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: install Xen headers and libraries
Expand All @@ -52,7 +52,7 @@ jobs:
args: --features xen -- -D warnings

kvm:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: clone libkvmi
Expand Down Expand Up @@ -92,45 +92,40 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clean
- name: install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- name: test KVM driver
uses: actions-rs/cargo@v1
with:
command: test
# The target arg is a workaround in order to prevent build.rs files from being compiled with RUSTFLAGS
# -Cpanic=abort can lead to issues with bindgen during compile time
# --lib only unit tests in the library, avoid integration tests
args: --lib --features kvm --no-fail-fast --target x86_64-unknown-linux-gnu
args: --lib --features kvm
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "coverage-%p-%m.profraw"

- name: install grcov
uses: actions-rs/[email protected]
with:
crate: grcov
version: latest
use-tool-cache: true
- name: generate coverage report
id: coverage
uses: actions-rs/[email protected]
- name: upload coverage report to codecov.io
uses: codecov/codecov-action@v1
with:
file: ${{ steps.coverage.outputs.report }}
flags: unittests
fail_ci_if_error: true

# - name: generate coverage report
# id: coverage
# uses: actions-rs/[email protected]

# - name: upload coverage report to codecov.io
# uses: codecov/codecov-action@v1
# with:
# file: ${{ steps.coverage.outputs.report }}
# flags: unittests
# fail_ci_if_error: true

memflow:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, windows-2022 ]
os: [ ubuntu-22.04, windows-2022 ]

steps:
- name: install stable toolchain with clippy
Expand All @@ -153,7 +148,7 @@ jobs:
args: --features mflow -- -D warnings

virtualbox_linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: clone Icebox repository
Expand Down Expand Up @@ -237,7 +232,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2022]
os: [ubuntu-22.04, windows-2022]

steps:
- name: install stable toolchain
Expand All @@ -263,7 +258,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2022]
os: [ubuntu-22.04, windows-2022]
steps:
- name: install stable toolchain with clippy
uses: actions-rs/toolchain@v1
Expand All @@ -284,7 +279,7 @@ jobs:
release_python:
# build a libmicrovmi python bindings release
# and upload it as artifact
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: install stable toolchain with clippy
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -334,7 +329,7 @@ jobs:

# upload all generated wheels *.whl
- name: upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: python_wheels
path: python/dist/manylinux/*
Expand All @@ -343,7 +338,7 @@ jobs:
# create a debian package with libmicrovmi release
# and upload it as artifact
needs: [format, xen, kvm, virtualbox_linux, memflow]
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -400,7 +395,7 @@ jobs:
run: cargo deb --no-strip -- --features xen,kvm,virtualbox,mflow

- name: upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: microvmi_deb
# microvmi_x.x.x_amd64.deb
Expand Down Expand Up @@ -466,30 +461,25 @@ jobs:
working-directory: libmicrovmi

- name: upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: microvmi_win32
path: libmicrovmi/output/*

github_release:
# create a Github release
# only when
# - push on master
# - tag starts with 'v*'
needs: [c_api, examples, release_python, release_debian_package, release_windows]
runs-on: ubuntu-20.04
# output these value to be used by other jobs so they can add assets
runs-on: ubuntu-22.04
outputs:
upload_url: ${{ steps.step_upload_url.outputs.upload_url }}
version: ${{ steps.get_version.outputs.version }}

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- uses: actions/cache@v2
with:
Expand All @@ -509,32 +499,27 @@ jobs:
release_name: ${{ steps.get_version.outputs.version }}

- id: step_upload_url
run: echo "::set-output name=upload_url::${{ steps.create_release.outputs.upload_url }}"
run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_OUTPUT

publish_debian_package:
# publish the debian package in the Github Release
needs: github_release
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
# the deploy action below depends on a checkout of the repo
# otherwise it fails trying to remote the 'origin' remote
# https://github.com/JamesIves/github-pages-deploy-action/issues/335
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# download artifacts
- uses: actions/download-artifact@v2
id: download
with:
name: microvmi_deb

- name: get artifact path and name
- name: Get artifact path and name
id: artefact
run: |
PATHNAME=$(find . -maxdepth 1 -name '*.deb')
NAME=$(basename $PATHNAME)
echo ::set-output name=path::${PATHNAME}
echo ::set-output name=name::${NAME}
NAME=$(basename "$PATHNAME")
echo "path=$PATHNAME" >> $GITHUB_OUTPUT
echo "name=$NAME" >> $GITHUB_OUTPUT

- name: Upload Debian package as Release asset
uses: actions/[email protected]
Expand All @@ -546,9 +531,10 @@ jobs:
asset_name: ${{ steps.artefact.outputs.name }}
asset_content_type: application/vnd.debian.binary-package


publish_windows:
# publish the windows release on Github Release
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
needs: github_release
steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -579,7 +565,7 @@ jobs:
publish_book:
# build and publish the book on Github pages
needs: github_release
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -608,7 +594,7 @@ jobs:

publish_crates_io:
needs: github_release
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

# publish on crates.io
# this should be triggered by cargo release, which creates a new tag and pushes to the repo
Expand All @@ -627,7 +613,7 @@ jobs:

publish_pypi:
needs: github_release
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
Expand Down
Loading
Loading