Skip to content

Commit ac8c249

Browse files
authored
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>
1 parent a91c4a7 commit ac8c249

2 files changed

Lines changed: 41 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ jobs:
124124
run: |
125125
make OPTIONS="-v --skip-platforms linux/s390x" -C pkg build
126126
127+
- name: Build Test Packages
128+
# ensures that the test packages are in linuxkit cache when we need them for tests later
129+
# Skip s390x as emulation is unreliable
130+
run: |
131+
make OPTIONS="-v --skip-platforms linux/s390x" -C test/pkg build
132+
127133
test_packages:
128134
name: Packages Tests
129135
needs: [ build_packages, build ]
@@ -181,7 +187,7 @@ jobs:
181187

182188
test_kernel:
183189
name: Kernel Tests
184-
needs: build
190+
needs: [ build_packages, build ]
185191
runs-on: ubuntu-latest
186192
steps:
187193
- name: Check out code
@@ -220,6 +226,14 @@ jobs:
220226
sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit
221227
/usr/local/bin/linuxkit version
222228
229+
- name: Restore Package Cache
230+
uses: actions/cache@v2
231+
with:
232+
path: ~/.linuxkit/cache/
233+
key: ${{ runner.os }}-linuxkit-${{ github.sha }}
234+
restore-keys: |
235+
${{ runner.os }}-linuxkit-
236+
223237
- name: Run Tests
224238
run: make test TEST_SUITE=linuxkit.kernel
225239

@@ -277,7 +291,7 @@ jobs:
277291

278292
test_platforms:
279293
name: Platform Tests
280-
needs: build
294+
needs: [ build_packages, build ]
281295
runs-on: ubuntu-latest
282296
steps:
283297
- name: Check out code
@@ -316,12 +330,20 @@ jobs:
316330
sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit
317331
/usr/local/bin/linuxkit version
318332
333+
- name: Restore Package Cache
334+
uses: actions/cache@v2
335+
with:
336+
path: ~/.linuxkit/cache/
337+
key: ${{ runner.os }}-linuxkit-${{ github.sha }}
338+
restore-keys: |
339+
${{ runner.os }}-linuxkit-
340+
319341
- name: Run Tests
320342
run: make test TEST_SUITE=linuxkit.platforms
321343

322344
test_security:
323345
name: Security Tests
324-
needs: build
346+
needs: [ build_packages, build ]
325347
runs-on: ubuntu-latest
326348
steps:
327349
- name: Check out code
@@ -360,5 +382,13 @@ jobs:
360382
sudo ln -s $(pwd)/bin/linuxkit-amd64-linux /usr/local/bin/linuxkit
361383
/usr/local/bin/linuxkit version
362384
385+
- name: Restore Package Cache
386+
uses: actions/cache@v2
387+
with:
388+
path: ~/.linuxkit/cache/
389+
key: ${{ runner.os }}-linuxkit-${{ github.sha }}
390+
restore-keys: |
391+
${{ runner.os }}-linuxkit-
392+
363393
- name: Run Tests
364394
run: make test TEST_SUITE=linuxkit.security

test/pkg/Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
DIRS = $(dir $(shell find . -maxdepth 2 -mindepth 2 -type f --name build.yml))
1+
DIRS = $(dir $(shell find . -maxdepth 2 -mindepth 2 -type f -name build.yml | sort))
22
.PHONY: push forcepush build forcebuild show-tag clean
33

4+
OPTIONS ?=
5+
46
push:
5-
@set -e; for d in $(DIRS); do linuxkit pkg push "$$d"; done
7+
linuxkit pkg push $(OPTIONS) $(DIRS)
68

79
forcepush:
8-
@set -e; for d in $(DIRS); do linuxkit pkg push --force "$$d"; done
10+
linuxkit pkg push $(OPTIONS) --force $(DIRS)
911

1012
build:
11-
@set -e; for d in $(DIRS); do linuxkit pkg build "$$d"; done
13+
linuxkit pkg build $(OPTIONS) $(DIRS)
1214

1315
forcebuild:
14-
@set -e; for d in $(DIRS); do linuxkit pkg build --force "$$d"; done
16+
linuxkit pkg build $(OPTIONS) --force $(DIRS)
1517

1618
show-tag:
17-
@set -e; for d in $(DIRS); do linuxkit pkg show-tag "$$d"; done
19+
linuxkit pkg show-tag $(OPTIONS) $(DIRS)
1820

1921
clean:

0 commit comments

Comments
 (0)