diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf35ec4f2..86a0bbe40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,6 +124,12 @@ jobs: run: | make OPTIONS="-v --skip-platforms linux/s390x" -C pkg build + - name: Build Test Packages + # ensures that the test packages are in linuxkit cache when we need them for tests later + # Skip s390x as emulation is unreliable + run: | + make OPTIONS="-v --skip-platforms linux/s390x" -C test/pkg build + test_packages: name: Packages Tests needs: [ build_packages, build ] @@ -181,7 +187,7 @@ jobs: test_kernel: name: Kernel Tests - needs: build + needs: [ build_packages, build ] runs-on: ubuntu-latest steps: - name: Check out code @@ -220,6 +226,14 @@ jobs: sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit /usr/local/bin/linuxkit version + - name: Restore Package Cache + uses: actions/cache@v2 + with: + path: ~/.linuxkit/cache/ + key: ${{ runner.os }}-linuxkit-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-linuxkit- + - name: Run Tests run: make test TEST_SUITE=linuxkit.kernel @@ -277,7 +291,7 @@ jobs: test_platforms: name: Platform Tests - needs: build + needs: [ build_packages, build ] runs-on: ubuntu-latest steps: - name: Check out code @@ -316,12 +330,20 @@ jobs: sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit /usr/local/bin/linuxkit version + - name: Restore Package Cache + uses: actions/cache@v2 + with: + path: ~/.linuxkit/cache/ + key: ${{ runner.os }}-linuxkit-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-linuxkit- + - name: Run Tests run: make test TEST_SUITE=linuxkit.platforms test_security: name: Security Tests - needs: build + needs: [ build_packages, build ] runs-on: ubuntu-latest steps: - name: Check out code @@ -360,5 +382,13 @@ jobs: sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit /usr/local/bin/linuxkit version + - name: Restore Package Cache + uses: actions/cache@v2 + with: + path: ~/.linuxkit/cache/ + key: ${{ runner.os }}-linuxkit-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-linuxkit- + - name: Run Tests run: make test TEST_SUITE=linuxkit.security diff --git a/test/pkg/Makefile b/test/pkg/Makefile index 41260d179..e8ceea7d8 100644 --- a/test/pkg/Makefile +++ b/test/pkg/Makefile @@ -1,19 +1,21 @@ -DIRS = $(dir $(shell find . -maxdepth 2 -mindepth 2 -type f --name build.yml)) +DIRS = $(dir $(shell find . -maxdepth 2 -mindepth 2 -type f -name build.yml | sort)) .PHONY: push forcepush build forcebuild show-tag clean +OPTIONS ?= + push: - @set -e; for d in $(DIRS); do linuxkit pkg push "$$d"; done + linuxkit pkg push $(OPTIONS) $(DIRS) forcepush: - @set -e; for d in $(DIRS); do linuxkit pkg push --force "$$d"; done + linuxkit pkg push $(OPTIONS) --force $(DIRS) build: - @set -e; for d in $(DIRS); do linuxkit pkg build "$$d"; done + linuxkit pkg build $(OPTIONS) $(DIRS) forcebuild: - @set -e; for d in $(DIRS); do linuxkit pkg build --force "$$d"; done + linuxkit pkg build $(OPTIONS) --force $(DIRS) show-tag: - @set -e; for d in $(DIRS); do linuxkit pkg show-tag "$$d"; done + linuxkit pkg show-tag $(OPTIONS) $(DIRS) clean: