Skip to content

Commit

Permalink
Make "test-all-samples" find java modules
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonydahanne committed Sep 26, 2023
1 parent d192190 commit 20fcc56
Showing 1 changed file with 23 additions and 49 deletions.
72 changes: 23 additions & 49 deletions .github/workflows/test-all-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,34 @@ on:
- 'scripts/.util/tools.json'

jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.paths.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Discover changed paths
id: paths
run: |
all_java_smoke_test_paths=$( find ./java -iname "smoke_test" | jq --raw-input | jq --slurp --compact-output )
all_other_smoke_test_paths='["ca-certificates","dotnet-core","git","go","nodejs","php","procfile","python","ruby","web-servers"]'
all_paths=$( echo -e "$all_java_smoke_test_paths\n$all_other_smoke_test_paths" | jq -s 'add' -c )
echo "These are the Java projects we'll run smoke tests against: $all_java_smoke_test_paths" >> $GITHUB_STEP_SUMMARY
echo "These are the other folders we'll run smoke tests against: : $all_other_smoke_test_paths" >> $GITHUB_STEP_SUMMARY
echo "These are all the smoke test locations: $all_paths" >> $GITHUB_STEP_SUMMARY
echo "matrix='{\"suite\":$all_paths}'" >> $GITHUB_OUTPUT
echo "This is how the matrix will look like: $(cat $GITHUB_OUTPUT)"
smoke:
name: Smoke Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 3
matrix:
suite:
- 'ca-certificates'
- 'dotnet-core'
- 'git'
- 'go'
- 'java'
- 'nodejs'
- 'php'
- 'procfile'
- 'python'
- 'ruby'
- 'web-servers'
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}

steps:
- name: Setup Go
Expand All @@ -41,44 +50,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Cache local Gradle repository
if: ${{ matrix.suite == 'java' }}
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('java/**/*.gradle*', 'java/**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache local Maven repository
if: ${{ matrix.suite == 'java' }}
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.m2/wrapper
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'java/**/maven-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup Directories
if: ${{ matrix.suite == 'java' }}
run: |
#!/usr/bin/env bash
set -euo pipefail
mkdir -p ~/.m2/repository
mkdir -p ~/.m2/repository/wrapper/dists
mkdir -p ~/.gradle/caches
mkdir -p ~/.gradle/wrapper/dists
chmod -R 775 ~/.m2
chmod -R 775 ~/.gradle
- name: Test ${{ matrix.suite }}
run: |
./scripts/smoke.sh --builder paketobuildpacks/builder:full --suite ${{ matrix.suite }}
./scripts/smoke.sh --builder paketobuildpacks/builder-jammy-full --suite ${{ matrix.suite }}
- name: File Issue
if: ${{ failure() && github.event_name != 'pull_request' }}
Expand Down

0 comments on commit 20fcc56

Please sign in to comment.