1
0
mirror of https://github.com/containers/youki synced 2024-11-26 06:08:07 +01:00
youki/justfile
Eric Fang 93a0afdeb0
Refactor CI (#2012)
* refactored the CI

- standarized all CI to use Ubuntu 22
- refactored the justfile
- moved the rust integration test to e2e
- moved the oci validation go version to e2e
- change the file filter action to `tj-actions/changed-files`
- refactored the dependencies installation to `just prepare` recipe
- fix readme (make -> just)
- fix readme minor lint issuefix

Signed-off-by: yihuaf <yihuaf@unkies.org>

* fix

Signed-off-by: yihuaf <yihuaf@unkies.org>

---------

Signed-off-by: yihuaf <yihuaf@unkies.org>
2023-06-07 11:03:25 +05:30

106 lines
2.6 KiB
Makefile

alias build := youki-release
alias youki := youki-dev
ROOT := `git rev-parse --show-toplevel`
# build
# build all binaries
build-all: youki-release rust-oci-tests-bin runtimetest
# build youki in dev mode
youki-dev:
./scripts/build.sh -o {{ ROOT }} -c youki
# build youki in release mode
youki-release:
./scripts/build.sh -o {{ ROOT }} -r -c youki
# build runtimetest binary
runtimetest:
./scripts/build.sh -o {{ ROOT }} -r -c runtimetest
# build rust oci tests binary
rust-oci-tests-bin:
./scripts/build.sh -o {{ ROOT }} -r -c integration-test
# Tests
# run oci tests
test-oci: oci-tests rust-oci-tests
# run all tests except rust-oci
test-all: unittest featuretest oci-tests containerd-test # currently not doing rust-oci here
# run cargo unittests
unittest:
cd ./crates
LD_LIBRARY_PATH=${HOME}/.wasmedge/lib cargo test --all --all-targets --all-features
# run purmutated faeture compilation tests
featuretest:
./scripts/features_test.sh
# run oci integration tests
oci-tests:
./scripts/oci_integration_tests.sh {{ ROOT }}
# run rust oci integration tests
rust-oci-tests: youki-release runtimetest rust-oci-tests-bin
./scripts/rust_integration_tests.sh {{ ROOT }}/youki
# validate rust oci integration tests on runc
validate-rust-oci-runc: runtimetest rust-oci-tests-bin
./scripts/rust_integration_tests.sh runc
# run containerd integration tests
containerd-test: youki-dev
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant provision --provision-with test
# misc
# run bpftrace hack
hack-bpftrace:
BPFTRACE_STRLEN=120 ./hack/debug.bt
# run linting on project
lint:
cargo fmt --all -- --check
cargo clippy --all --all-targets --all-features -- -D warnings
# run format on project
format:
cargo fmt --all
# cleans up generated artifacts
clean:
./scripts/clean.sh {{ ROOT }}
ci-prepare:
#!/usr/bin/env bash
set -euo pipefail
# Check if system is Ubuntu
if [[ -f /etc/lsb-release ]]; then
source /etc/lsb-release
if [[ $DISTRIB_ID == "Ubuntu" ]]; then
echo "System is Ubuntu"
sudo apt-get -y update
sudo apt-get install -y \
pkg-config \
libsystemd-dev \
libdbus-glib-1-dev \
build-essential \
libelf-dev \
libseccomp-dev \
libclang-dev \
libssl-dev \
criu
exit 0
fi
fi
echo "Unknown system. The CI is only configured for Ubuntu. You will need to forge your own path. Good luck!"
exit 1