mirror of
https://github.com/containers/youki
synced 2024-11-22 17:02:00 +01:00
Change targets in the makefile
This commit is contained in:
parent
997bc43839
commit
6becc9af4e
@ -27,7 +27,7 @@ jobs:
|
||||
profile: minimal
|
||||
|
||||
- name: Building PR branch
|
||||
run: make release-build
|
||||
run: make youki-release
|
||||
|
||||
- name: Uploading PR build to artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
@ -59,7 +59,7 @@ jobs:
|
||||
profile: minimal
|
||||
|
||||
- name: Building main branch
|
||||
run: ./build.sh --release
|
||||
run: make youki-release
|
||||
|
||||
- name: Uploading main build to artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
|
@ -43,8 +43,8 @@ jobs:
|
||||
sudo mv runc.amd64 /usr/bin/runc
|
||||
sudo chmod 755 /usr/bin/runc
|
||||
- name: Build
|
||||
run: make release-build
|
||||
run: make youki-release runtimetest rust-oci-tests-bin
|
||||
- name: Validate tests on runc
|
||||
run: make validate-rust-tests
|
||||
run: make validate-rust-oci-runc
|
||||
- name: Validate tests on youki
|
||||
run: make integration-test
|
||||
run: make rust-oci-tests
|
||||
|
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@ -124,6 +124,6 @@ jobs:
|
||||
with:
|
||||
go-version: "1.17.6"
|
||||
- name: Build
|
||||
run: make release-build
|
||||
run: make youki-release
|
||||
- name: Run integration tests
|
||||
run: make oci-integration-test
|
||||
run: make oci-tests
|
||||
|
2
.github/workflows/podman_tests.yaml
vendored
2
.github/workflows/podman_tests.yaml
vendored
@ -9,7 +9,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- run: sudo apt-get -y update
|
||||
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev libgpgme-dev bats
|
||||
- run: make build
|
||||
- run: make youki-dev
|
||||
- run: sudo cp youki /usr/local/bin
|
||||
- name: Clone podman repository
|
||||
uses: actions/checkout@v3
|
||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
||||
toolchain: stable
|
||||
override: true
|
||||
- name: Build
|
||||
run: make release-build
|
||||
run: make youki-release
|
||||
- name: test
|
||||
run: make test-all
|
||||
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@
|
||||
|
||||
**/target
|
||||
/runtimetest-target
|
||||
/bin
|
||||
.vagrant/
|
||||
|
||||
tags
|
||||
|
50
Makefile
50
Makefile
@ -1,33 +1,53 @@
|
||||
ROOT = $(shell git rev-parse --show-toplevel)
|
||||
|
||||
build:
|
||||
./scripts/build.sh -o $(ROOT)
|
||||
# builds
|
||||
|
||||
release-build:
|
||||
./scripts/build.sh -o $(ROOT) -r
|
||||
build: youki-release
|
||||
|
||||
test-all: test oci-integration-test integration-test features-test
|
||||
youki: youki-dev # helper
|
||||
|
||||
test: build
|
||||
cd crates && cargo test
|
||||
youki-dev:
|
||||
./scripts/build.sh -o $(ROOT) -c youki
|
||||
|
||||
features-test: build
|
||||
youki-release:
|
||||
./scripts/build.sh -o $(ROOT) -r -c youki
|
||||
|
||||
runtimetest:
|
||||
./scripts/build.sh -o $(ROOT) -r -c runtimetest
|
||||
|
||||
rust-oci-tests-bin:
|
||||
./scripts/build.sh -o $(ROOT) -r -c integration-test
|
||||
|
||||
all: youki-release rust-oci-tests-bin runtimetest
|
||||
|
||||
# Tests
|
||||
unittest:
|
||||
cd ./crates && cargo test --all-targets --all-features
|
||||
|
||||
featuretest:
|
||||
./scripts/features_test.sh
|
||||
|
||||
oci-integration-test:
|
||||
oci-tests: youki-release
|
||||
./scripts/oci_integration_tests.sh $(ROOT)
|
||||
|
||||
integration-test:
|
||||
rust-oci-tests: youki-release runtimetest rust-oci-tests-bin
|
||||
./scripts/rust_integration_tests.sh $(ROOT)/youki
|
||||
|
||||
validate-rust-tests:
|
||||
validate-rust-oci-runc: runtimetest rust-oci-tests-bin
|
||||
./scripts/rust_integration_tests.sh runc
|
||||
|
||||
clean:
|
||||
./scripts/clean.sh $(ROOT)
|
||||
|
||||
containerd-test:
|
||||
containerd-test: youki-dev
|
||||
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant up
|
||||
VAGRANT_VAGRANTFILE=Vagrantfile.containerd2youki vagrant provision --provision-with test
|
||||
|
||||
test-oci: oci-tests rust-oci-tests
|
||||
|
||||
test-all: unittest featuretest oci-tests containerd-test # currently not doing rust-oci here
|
||||
|
||||
# Misc
|
||||
|
||||
lint:
|
||||
cargo clippy --all-targets --all-features
|
||||
|
||||
clean:
|
||||
./scripts/clean.sh $(ROOT)
|
||||
|
@ -170,7 +170,7 @@ $ sudo dnf install \
|
||||
```console
|
||||
$ git clone git@github.com:containers/youki.git
|
||||
$ cd youki
|
||||
$ make build # or release-build
|
||||
$ make youki-dev # or youki-release
|
||||
$ ./youki -h # you can get information about youki command
|
||||
```
|
||||
|
||||
@ -183,7 +183,7 @@ Let's try to run a container that executes `sleep 30` with youki. This tutorial
|
||||
```console
|
||||
$ git clone git@github.com:containers/youki.git
|
||||
$ cd youki
|
||||
$ make build # or release-build
|
||||
$ make youki-dev # or youki-release
|
||||
|
||||
$ mkdir -p tutorial/rootfs
|
||||
$ cd tutorial
|
||||
@ -273,7 +273,7 @@ Go and node-tap are required to run integration tests. See the [opencontainers/r
|
||||
|
||||
```console
|
||||
$ git submodule update --init --recursive
|
||||
$ make oci-integration-test
|
||||
$ make oci-tests
|
||||
```
|
||||
|
||||
### Setting up Vagrant
|
||||
@ -294,7 +294,7 @@ $ VAGRANT_VAGRANTFILE=Vagrantfile.root vagrant ssh
|
||||
|
||||
# in virtual machine
|
||||
$ cd youki
|
||||
$ make build # or release-build
|
||||
$ make youki-dev # or youki-release
|
||||
```
|
||||
|
||||
# Community
|
||||
|
@ -58,7 +58,7 @@ Once you have cloned the source, you can build it using
|
||||
```console
|
||||
# go into the cloned directory
|
||||
cd youki
|
||||
make build # or release-build
|
||||
make youki-dev # or youki-release
|
||||
./youki -h # get information about youki command
|
||||
```
|
||||
|
||||
@ -106,5 +106,5 @@ VAGRANT_VAGRANTFILE=Vagrantfile.root vagrant ssh
|
||||
|
||||
# in virtual machine
|
||||
$ cd youki
|
||||
$ make build # or release-build
|
||||
$ make youki-dev # or youki-release
|
||||
```
|
||||
|
@ -11,8 +11,9 @@ usage_exit() {
|
||||
|
||||
VERSION=debug
|
||||
TARGET="$(uname -m)-unknown-linux-gnu"
|
||||
CRATE="youki"
|
||||
RUNTIMETEST_TARGET="$ROOT/runtimetest-target"
|
||||
while getopts f:ro:h OPT; do
|
||||
while getopts f:ro:c:h OPT; do
|
||||
case $OPT in
|
||||
f) features=${OPTARG}
|
||||
;;
|
||||
@ -20,6 +21,8 @@ while getopts f:ro:h OPT; do
|
||||
;;
|
||||
r) VERSION=release
|
||||
;;
|
||||
c) CRATE=${OPTARG}
|
||||
;;
|
||||
h) usage_exit
|
||||
;;
|
||||
\?) usage_exit
|
||||
@ -44,11 +47,23 @@ echo "* features: ${features}"
|
||||
OUTPUT=${output:-$ROOT/bin}
|
||||
[ ! -d $OUTPUT ] && mkdir -p $OUTPUT
|
||||
|
||||
cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin youki
|
||||
cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin integration_test
|
||||
CARGO_TARGET_DIR=${RUNTIMETEST_TARGET} RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin runtimetest
|
||||
|
||||
mv ${ROOT}/target/${TARGET}/${VERSION}/{youki,integration_test} ${OUTPUT}/
|
||||
mv ${RUNTIMETEST_TARGET}/${TARGET}/${VERSION}/runtimetest ${OUTPUT}/
|
||||
if [ "$CRATE" == "youki" ]; then
|
||||
rm -f ${OUTPUT}/youki
|
||||
cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin youki
|
||||
mv ${ROOT}/target/${TARGET}/${VERSION}/youki ${OUTPUT}/
|
||||
fi
|
||||
|
||||
if [ "$CRATE" == "integration-test" ]; then
|
||||
rm -f ${OUTPUT}/integration_test
|
||||
cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin integration_test
|
||||
mv ${ROOT}/target/${TARGET}/${VERSION}/integration_test ${OUTPUT}/
|
||||
fi
|
||||
|
||||
if [ "$CRATE" == "runtimetest" ]; then
|
||||
rm -f ${OUTPUT}/runtimetest
|
||||
CARGO_TARGET_DIR=${RUNTIMETEST_TARGET} RUSTFLAGS="-Ctarget-feature=+crt-static" cargo build --target ${TARGET} ${OPTION} ${FEATURES} --bin runtimetest
|
||||
mv ${RUNTIMETEST_TARGET}/${TARGET}/${VERSION}/runtimetest ${OUTPUT}/
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@ -2,11 +2,14 @@
|
||||
# we don't set -eu here, as some of the binaries might be potentially be missing
|
||||
# and that is fine, that means they are already removed.
|
||||
|
||||
for bin in youki integration_test runtimetest bundle.tar.gz test.log; do
|
||||
for bin in youki integration_test runtimetest test.log; do
|
||||
if [ -f $bin ]; then
|
||||
rm ${1}/$bin
|
||||
fi
|
||||
done
|
||||
|
||||
rm -rf runtimetest-target
|
||||
|
||||
cargo clean
|
||||
|
||||
exit 0 # unconditionally return zero
|
||||
|
Loading…
Reference in New Issue
Block a user