-
Notifications
You must be signed in to change notification settings - Fork 115
55 lines (49 loc) · 1.71 KB
/
test-pull-request-java.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
name: Test Pull Request (Java)
on:
merge_group:
pull_request:
branches:
- main
paths:
- 'java/**'
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.paths.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Discover changed paths
id: paths
run: |
env
# see: https://stackoverflow.com/a/8721550/24069 for usage of paste
changed_java_folders=$( git diff --name-only --merge-base origin/$GITHUB_BASE_REF $GITHUB_SHA | xargs -n 1 dirname | uniq | grep -v "^\." | paste -s -d, - )
echo "These are the Java folders where we found changes for this PR : $changed_java_folders" >> $GITHUB_STEP_SUMMARY
echo "matrix={\"java_sample_folder\":[$changed_java_folders]}" >> $GITHUB_OUTPUT
echo "This is how the matrix will look like: $(cat $GITHUB_OUTPUT)"
smoke:
needs: prepare
name: Smoke Tests
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
# java_sample_folder:
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.18.x
- name: Checkout
uses: actions/checkout@v4
- name: Smoke Test Java samples
run: |
echo "About to run the smoke test script against this suite folder: ${{ matrix.java_sample_folder }}"
./scripts/smoke.sh --suite ${{ matrix.java_sample_folder }}" \
--builder paketobuildpacks/builder:full \
--builder paketobuildpacks/builder:base \
--builder paketobuildpacks/builder:tiny