Skip to content

Commit c906eb9

Browse files
Make "test-all-samples" find java modules
1 parent a629a40 commit c906eb9

File tree

1 file changed

+25
-50
lines changed

1 file changed

+25
-50
lines changed

.github/workflows/test-all-samples.yml

Lines changed: 25 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,73 +12,48 @@ on:
1212
- 'scripts/.util/tools.json'
1313

1414
jobs:
15+
prepare:
16+
name: Prepare
17+
runs-on: ubuntu-latest
18+
outputs:
19+
matrix: ${{ steps.paths.outputs.matrix }}
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Discover changed paths
24+
id: paths
25+
run: |
26+
all_java_smoke_test_paths=$( find ./java -iname "smoke_test" | jq --raw-input | jq --slurp --compact-output )
27+
all_other_smoke_test_paths='["ca-certificates","dotnet-core","git","go","nodejs","php","procfile","python","ruby","web-servers"]'
28+
all_paths=$( echo -e "$all_java_smoke_test_paths\n$all_other_smoke_test_paths" | jq -s 'add' -c )
29+
30+
echo "These are the Java projects we'll run smoke tests against: $all_java_smoke_test_paths" >> $GITHUB_STEP_SUMMARY
31+
echo "These are the other folders we'll run smoke tests against: : $all_other_smoke_test_paths" >> $GITHUB_STEP_SUMMARY
32+
echo "These are all the smoke test locations: $all_paths" >> $GITHUB_STEP_SUMMARY
33+
echo "matrix={\"suite\":$all_paths}" >> $GITHUB_OUTPUT
34+
echo "This is how the matrix will look like: $(cat $GITHUB_OUTPUT)"
35+
1536
smoke:
37+
needs: prepare
1638
name: Smoke Tests
1739
runs-on: ubuntu-latest
1840
strategy:
1941
fail-fast: false
2042
max-parallel: 3
21-
matrix:
22-
suite:
23-
- 'ca-certificates'
24-
- 'dotnet-core'
25-
- 'git'
26-
- 'go'
27-
- 'java'
28-
- 'nodejs'
29-
- 'php'
30-
- 'procfile'
31-
- 'python'
32-
- 'ruby'
33-
- 'web-servers'
43+
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
3444

3545
steps:
3646
- name: Setup Go
3747
uses: actions/setup-go@v4
3848
with:
39-
go-version: 1.18.x
49+
go-version: 1.20.x
4050

4151
- name: Checkout
4252
uses: actions/checkout@v4
4353

44-
- name: Cache local Gradle repository
45-
if: ${{ matrix.suite == 'java' }}
46-
uses: actions/cache@v3
47-
with:
48-
path: |
49-
~/.gradle/caches
50-
~/.gradle/wrapper
51-
key: ${{ runner.os }}-gradle-${{ hashFiles('java/**/*.gradle*', 'java/**/gradle-wrapper.properties') }}
52-
restore-keys: |
53-
${{ runner.os }}-gradle-
54-
55-
- name: Cache local Maven repository
56-
if: ${{ matrix.suite == 'java' }}
57-
uses: actions/cache@v3
58-
with:
59-
path: |
60-
~/.m2/repository
61-
~/.m2/wrapper
62-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'java/**/maven-wrapper.properties') }}
63-
restore-keys: |
64-
${{ runner.os }}-maven-
65-
66-
- name: Setup Directories
67-
if: ${{ matrix.suite == 'java' }}
68-
run: |
69-
#!/usr/bin/env bash
70-
set -euo pipefail
71-
72-
mkdir -p ~/.m2/repository
73-
mkdir -p ~/.m2/repository/wrapper/dists
74-
mkdir -p ~/.gradle/caches
75-
mkdir -p ~/.gradle/wrapper/dists
76-
chmod -R 775 ~/.m2
77-
chmod -R 775 ~/.gradle
78-
7954
- name: Test ${{ matrix.suite }}
8055
run: |
81-
./scripts/smoke.sh --builder paketobuildpacks/builder:full --suite ${{ matrix.suite }}
56+
./scripts/smoke.sh --builder paketobuildpacks/builder-jammy-full --suite ${{ matrix.suite }}
8257
8358
- name: File Issue
8459
if: ${{ failure() && github.event_name != 'pull_request' }}

0 commit comments

Comments
 (0)