From d64c2d9122587d45ab9781508e274f3f5525b5f0 Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Thu, 21 Sep 2023 13:55:26 -0400 Subject: [PATCH] several jobs --- .github/workflows/test-pull-request-java.yml | 54 ++++++++++++++------ 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test-pull-request-java.yml b/.github/workflows/test-pull-request-java.yml index 0a02c0f3..c0585351 100644 --- a/.github/workflows/test-pull-request-java.yml +++ b/.github/workflows/test-pull-request-java.yml @@ -9,11 +9,35 @@ on: - '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 "^\." | sed "s/^/\"/;s/$/\"/" | 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 - steps: + strategy: + matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} +# java_sample_folder: + steps: - name: Setup Go uses: actions/setup-go@v4 with: @@ -21,24 +45,20 @@ jobs: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Discover changed paths - id: paths - run: | - env - echo "a PR was triggered; let's find out which modules were updated" - # see: https://stackoverflow.com/a/8721550/24069 for usage of paste - echo "changed_java_projects=$( git diff --name-only --merge-base origin/$GITHUB_BASE_REF $GITHUB_SHA | xargs -n 1 dirname | uniq | grep -v "^\." | paste -s -d, -)" >> $GITHUB_OUTPUT - echo "These are the modules that we'll work with: $(cat $GITHUB_OUTPUT)" - name: Test Java Samples +# with: +# yo: "YO" +# java_sample_folder: ${{ matrix.java_sample_folder }} run: | env - echo ${{ steps.paths.outputs.changed_java_projects }} + echo "ABout to run the smoke test script against this suite folder: ${{ matrix.java_sample_folder }}" +# echo "long style ${{needs.prepare.outputs.changed_java_projects}}" +# echo "short $CHANGED_JAVA_PROJECTS" -# ./scripts/smoke.sh --suite java \ -# --builder paketobuildpacks/builder:full \ -# --builder paketobuildpacks/builder:base \ -# --builder paketobuildpacks/builder:tiny + ./scripts/smoke.sh --suite ${{ matrix.java_sample_folder }}" \ + --builder paketobuildpacks/builder:full \ + --builder paketobuildpacks/builder:base \ + --builder paketobuildpacks/builder:tiny +# env: +# CHANGED_JAVA_PROJECTS: ${{needs.prepare.outputs.changed_java_projects}}