Skip to content

fix: still fixing pyelftools for bin2cbundle step in ci #27

fix: still fixing pyelftools for bin2cbundle step in ci

fix: still fixing pyelftools for bin2cbundle step in ci #27

name: 🧪 Tests and Checks
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-libkrun:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update -qqy
sudo apt-get install -y jq libelf-dev build-essential flex bison libssl-dev libncurses5-dev python3-pip
pip3 install --user pyelftools
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build libkrun
uses: actions-rs/cargo@v1
run: |
./build_libkrun.sh
- name: Cache libkrun
uses: actions/cache@v3
with:
path: |
/usr/local/lib64/libkrunfw.so
/usr/local/lib64/libkrun.so
key: ${{ runner.os }}-libkrun-${{ hashFiles('**/build_libkrun.sh') }}
run-checks:
needs: build-libkrun
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain:
- stable
# - nightly
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Cache Project
uses: Swatinem/rust-cache@v2
- name: Restore libkrun cache
uses: actions/cache@v3
with:
path: |
/usr/local/lib64/libkrunfw.so
/usr/local/lib64/libkrun.so
key: ${{ runner.os }}-libkrun-${{ hashFiles('**/build_libkrun.sh') }}
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
components: rustfmt, clippy
toolchain: ${{ matrix.rust-toolchain }}
- name: Check Format
uses: actions-rs/cargo@v1
with:
args: --all -- --check
command: fmt
toolchain: ${{ matrix.rust-toolchain }}
- name: Run Linter
uses: actions-rs/cargo@v1
with:
args: --all -- -D warnings
command: clippy
toolchain: ${{ matrix.rust-toolchain }}
- name: Check Advisories
if: ${{ matrix.rust-toolchain == 'stable' }}
uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check advisories
continue-on-error: true
- name: Check Bans, Licenses, and Sources
if: ${{ matrix.rust-toolchain == 'stable' }}
uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check bans licenses sources
- name: Test Release
if: ${{ matrix.rust-toolchain == 'stable' && github.event_name == 'push' }}
run: cargo build --release
run-tests:
needs: build-libkrun
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust-toolchain:
- stable
- nightly
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Environment Packages
run: |
sudo apt-get update -qqy
sudo apt-get install jq
- name: Cache Project
uses: Swatinem/rust-cache@v2
- name: Restore libkrun cache
uses: actions/cache@v3
with:
path: |
/usr/local/lib64/libkrunfw.so
/usr/local/lib64/libkrun.so
key: ${{ runner.os }}-libkrun-${{ hashFiles('**/build_libkrun.sh') }}
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: ${{ matrix.rust-toolchain }}
- name: Run Tests
run: cargo test --all-features