1
0
mirror of https://github.com/containers/youki synced 2024-11-23 17:32:15 +01:00
youki/.github/workflows/main.yml
Yashodhan 79b6450a86
Replace Makefiles with Just (#1823)
Refactored the build system using `justfile`.

* Use just in CI instead of makefiles

* Remove makefiles completely

* Increase timeout in rust validation
2023-06-05 09:24:33 -07:00

120 lines
3.9 KiB
YAML

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
changes:
runs-on: ubuntu-20.04
timeout-minutes: 15
outputs:
dirs: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
crates/youki:
- 'crates/youki/**'
crates/libcontainer:
- 'crates/libcontainer/**'
crates/libcgroups:
- 'crates/libcgroups/**'
tests/rust-integration-tests/runtimetest:
- './tests/rust-integration-tests/runtimetest/**'
tests/rust-integration-tests/integration_test:
- './tests/rust-integration-tests/integration_test/**'
tests/rust-integration-tests/test_framework:
- './tests/rust-integration-tests/test_framework/**'
check:
needs: [changes]
if: ${{ !contains(needs.changes.outputs.dirs, '[]') }}
runs-on: ubuntu-20.04
timeout-minutes: 15
strategy:
matrix:
dirs: ${{ fromJSON(needs.changes.outputs.dirs) }}
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.3.7
- run: rustup component add rustfmt clippy
- name: Install requirements
run: sudo ./.github/scripts/dependency.sh
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev
- name: Check formatting
run: cargo fmt --all -- --check
working-directory: ${{matrix.dirs}}
- name: Check clippy lints
working-directory: ${{matrix.dirs}}
run: cargo clippy --all-targets --all-features -- -D warnings
tests:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Install rus
run: rustup show
- run: sudo apt-get -y update
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev
- name: Run tests
run: |
export LD_LIBRARY_PATH=$HOME/.wasmedge/lib
cd ./crates && cargo test --all --all-features --no-fail-fast
coverage:
runs-on: ubuntu-20.04
timeout-minutes: 15
name: Run test coverage
steps:
- uses: actions/checkout@v3
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.3.7
- name: Install llvm-tools-preview
run: rustup component add llvm-tools-preview
- name: install cargo-llvm-cov
uses: taiki-e/install-action@v1
with:
tool: cargo-llvm-cov@0.4.0
- name: Install requirements
run: sudo ./.github/scripts/dependency.sh
- name: Run Test Coverage for youki
run: |
cargo llvm-cov clean --workspace
cargo llvm-cov --no-report
cargo llvm-cov --no-run --lcov --ignore-filename-regex "libcgroups/src/systemd/dbus/systemd_api.rs" --output-path ./coverage.lcov
- name: Upload Youki Code Coverage Results
uses: codecov/codecov-action@v2
with:
file: ./coverage.lcov
integration_tests:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Rust toolchain and cache
uses: actions-rust-lang/setup-rust-toolchain@v1.3.7
- name: Install requirements
run: sudo ./.github/scripts/dependency.sh
- name: Install just
uses: taiki-e/install-action@just
- uses: actions/setup-go@v3
with:
go-version: "1.17.6"
cache: true
cache-dependency-path: tests/oci-runtime-tests/src/github.com/opencontainers/runtime-tools/go.sum
- name: Build
run: just youki-release
- name: Run integration tests
run: just oci-tests