forked from aklivity/zilla
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (66 loc) · 2.08 KB
/
example-test-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Examples test Checker
on:
push:
workflow_dispatch:
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK 22
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 22
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: |
~/.m2/repository
!~/.m2/repository/io/aklivity/zilla
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build with Maven
run: ./mvnw -B -U -nsu -Ddocker.logStdout -Ddocker.verbose -DskipTests install jacoco:report-aggregate
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
- name: Create container tar
run: docker save ghcr.io/aklivity/zilla:develop-SNAPSHOT > /tmp/zilla-image.tar
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: zilla-image
path: /tmp/zilla-image.tar
get-example-dirs:
runs-on: ubuntu-latest
steps:
- name: Checkout examples repo
uses: actions/checkout@v4
with:
repository: aklivity/zilla-examples
ref: refs/heads/example-startup-compose # change to main
- id: dirs
run: echo "dirs=$(ls -d */ | jq --raw-input --slurp --compact-output 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT}
run_tests:
needs: get-example-dirs
runs-on: ubuntu-latest
strategy:
matrix:
dir: ${{ fromJson(needs.get-example-dirs.outputs.dirs) }}
steps:
- run: echo ${{ matrix.dir }}
testing:
# if: ${{ needs.get-example-dirs.outputs.dirs != '' }}
strategy:
matrix:
dir: ${{fromJson(needs.get-example-dirs.outputs.dirs)}}
fail-fast: false
needs:
- build-image
- get-example-dirs
uses: ./.github/workflows/reusable_test_runner.yaml
with:
example-dir: ${{ matrix.dir }}
zilla-image-tag: develop-SNAPSHOT
zilla-image-artifact-name: zilla-image