Test pkgs ci makefile (#3892)

* simplify test/pkg/Makefile

Signed-off-by: Avi Deitcher <avi@deitcher.net>

* ensure pkg and test/pkg built before downstream workflows in CI

Signed-off-by: Avi Deitcher <avi@deitcher.net>

Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
Avi Deitcher 2023-01-04 11:52:48 +02:00 committed by GitHub
parent a91c4a77b0
commit ac8c24934c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 9 deletions

View File

@ -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

View File

@ -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: