diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml new file mode 100644 index 000000000..3b7773f15 --- /dev/null +++ b/.semaphore/semaphore.yml @@ -0,0 +1,35 @@ +version: v1.0 +name: CI Build + +agent: + machine: + type: e1-standard-2 + os_image: ubuntu1804 + +blocks: + - name: Run tests + task: + env_vars: + - name: GIMME_GO_VERSION + value: "1.14.2" + jobs: + - name: Tests + commands: + - eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | bash)" # install specific go version + - | + # https://ignite.readthedocs.io/en/latest/installation.html + sudo apt-get install -y cpu-checker + sudo apt-get install -y --no-install-recommends dmsetup openssh-client git binutils + # Install containerd if it's not present -- prevents breaking docker-ce installations + sudo which containerd || sudo apt-get install -y --no-install-recommends containerd + - kvm-ok + - | + export CNI_VERSION=v0.8.7 + export ARCH=$([ $(uname -m) = "x86_64" ] && echo amd64 || echo arm64) + sudo mkdir -p /opt/cni/bin + curl -sSL https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | sudo tar -xz -C /opt/cni/bin + - checkout + - make ignite ignite-spawn ignited bin/amd64/Dockerfile GO_MAKE_TARGET=local + - make test + - make root-test + - make e2e-nobuild # this depends on Semaphore CI's support for nested virtualization diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 818dcb595..000000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: minimal # git checkout will not be in a GOPATH -dist: bionic # Ubuntu 18.04 required for nested-virt - -services: -- docker - -env: -- GIMME_GO_VERSION=1.14.2 - -install: -- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | bash)" # install specific go version -- | - # https://ignite.readthedocs.io/en/latest/installation.html - sudo apt-get install -y cpu-checker - sudo apt-get install -y --no-install-recommends dmsetup openssh-client git binutils - sudo which containerd || sudo apt-get install -y --no-install-recommends containerd - # Install containerd if it's not present -- prevents breaking docker-ce installations -- kvm-ok -- | - export CNI_VERSION=v0.8.7 - export ARCH=$([ $(uname -m) = "x86_64" ] && echo amd64 || echo arm64) - sudo mkdir -p /opt/cni/bin - curl -sSL https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | sudo tar -xz -C /opt/cni/bin - -before_script: -- make ignite ignite-spawn ignited bin/amd64/Dockerfile GO_MAKE_TARGET=local - -script: -- make test -- make root-test -- make e2e-nobuild # this depends on Travis CI's support for nested virtualization diff --git a/Makefile b/Makefile index 6440ee9f0..c54bd3544 100644 --- a/Makefile +++ b/Makefile @@ -192,7 +192,7 @@ test-in-docker: # Run tests that require root. root-test: - sudo $(shell which go) test -mod=vendor -v $(TEST_REQUIRES_ROOT_PACKAGES) -count=$(TEST_COUNT) + sudo -E $(shell which go) test -mod=vendor -v $(TEST_REQUIRES_ROOT_PACKAGES) -count=$(TEST_COUNT) graph: hack/graph.sh @@ -278,7 +278,7 @@ bin/docs/builder-image.tar: e2e: build-all e2e-nobuild e2e-nobuild: - sudo IGNITE_E2E_HOME=$(shell pwd) \ + sudo -E IGNITE_E2E_HOME=$(shell pwd) \ $(shell which go) test \ $(TEST_E2E_PACKAGES) -v -mod=vendor \ -count $(E2E_COUNT) \ diff --git a/cmd/ignite/run/testdata/output/ps-filtered-table.txt b/cmd/ignite/run/testdata/output/ps-filtered-table.txt index 4c96fb52e..5f9d51b64 100644 --- a/cmd/ignite/run/testdata/output/ps-filtered-table.txt +++ b/cmd/ignite/run/testdata/output/ps-filtered-table.txt @@ -1,2 +1,2 @@ VM ID IMAGE KERNEL SIZE CPUS MEMORY CREATED STATUS IPS PORTS NAME -bfc80c948b1e2419 foo/bar:latest foo/bar:latest 0 B 0 0 B 20y ago Stopped vm2 +bfc80c948b1e2419 foo/bar:latest foo/bar:latest 0 B 0 0 B 21y ago Stopped vm2 diff --git a/cmd/ignite/run/testdata/output/ps-table.txt b/cmd/ignite/run/testdata/output/ps-table.txt index d69208282..b4a77dfe1 100644 --- a/cmd/ignite/run/testdata/output/ps-table.txt +++ b/cmd/ignite/run/testdata/output/ps-table.txt @@ -1,4 +1,4 @@ VM ID IMAGE KERNEL SIZE CPUS MEMORY CREATED STATUS IPS PORTS NAME -20e1d566ce318ada foo/bar:latest foo/bar:latest 0 B 0 0 B 20y ago Stopped vm1 -bfc80c948b1e2419 foo/bar:latest foo/bar:latest 0 B 0 0 B 20y ago Stopped vm2 -cddc37ba657766e3 foo/bar:latest foo/bar:latest 0 B 0 0 B 20y ago Stopped vm3 +20e1d566ce318ada foo/bar:latest foo/bar:latest 0 B 0 0 B 21y ago Stopped vm1 +bfc80c948b1e2419 foo/bar:latest foo/bar:latest 0 B 0 0 B 21y ago Stopped vm2 +cddc37ba657766e3 foo/bar:latest foo/bar:latest 0 B 0 0 B 21y ago Stopped vm3