2323
2424# Workflow to check pull requests and new commits to main branches
2525# This checks the source in the state as if after the merge.
26- name : Manual workflow
26+ name : Manual build
2727on :
2828 workflow_dispatch :
29+ workflow_call :
30+ secrets :
31+ GCP_CREDENTIALS :
32+ KCBQ_TEST_PROJECT :
33+ KCBQ_TEST_DATASET :
34+ KCBQ_TEST_BUCKET :
2935
3036permissions :
3137 contents : write
@@ -36,7 +42,7 @@ permissions:
3642# Disallow concurrent runs for the same PR by cancelling in-progress runs
3743# when new commits are pushed
3844concurrency :
39- group : ${{ github.workflow }} -${{ github.event.pull_request.number || github.ref }}
45+ group : Manual_Build -${{ github.event.pull_request.number || github.ref }}
4046 cancel-in-progress : true
4147
4248jobs :
@@ -50,61 +56,32 @@ jobs:
5056 env :
5157 GITHUB_CONTEXT : ${{ toJson(github) }}
5258 run : echo "$GITHUB_CONTEXT"
53- - name : Test
59+ - name : Set up JDK 17
60+ uses : actions/setup-java@v4
61+ with :
62+ distribution : ' adopt'
63+ java-version : 17
64+ cache : maven
65+ - name : Integration tests (Maven)
5466 env :
55- TEST_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56- GCP_CREDENTIALS : ${{ secrets.GCP_CREDENTIALS }}
67+ # Necessary for client builder integration tests that run with
68+ # default application credentials
69+ CREDENTIALS_JSON : ${{ secrets.GCP_CREDENTIALS }}
70+ GOOGLE_APPLICATION_CREDENTIALS : /tmp/creds.json
71+ KCBQ_TEST_KEYFILE : /tmp/creds.json
72+ KCBQ_TEST_KEY_SOURCE : FILE
73+ KCBQ_TEST_PROJECT : ${{ secrets.KCBQ_TEST_PROJECT }}
74+ KCBQ_TEST_DATASET : ${{ secrets.KCBQ_TEST_DATASET }}
75+ KCBQ_TEST_BUCKET : ${{ secrets.KCBQ_TEST_BUCKET }}
5776 run : |
58- echo ${#TEST_GITHUB_TOKEN}
59- echo ${#GCP_CREDENTIALS}
60- # - name: Set up JDK 17
61- # uses: actions/setup-java@v4
62- # with:
63- # distribution: 'adopt'
64- # java-version: 17
65- # cache: maven
66- # - name: License header check
67- # run: |
68- # mvn -ntp license:remove license:format
69- # if [[ -n $(git status -s) ]]; then
70- # echo 1>&2 'Some files do not have the correct license header:'
71- # git diff --name-only 1>&2
72- # echo 1>&2 'Please update the license headers for these files by running `mvn license:remove license:format`'
73- # exit 1
74- # fi
75- # - name: Build (Maven)
76- # run: mvn -P ci --batch-mode clean package -DskipTests
77- # - name: Unit tests (Maven)
78- # run: mvn -ntp -P ci --batch-mode test
79- # - name: "upload build failure reports"
80- # uses: actions/upload-artifact@v4
81- # if: failure()
82- # with:
83- # name: unit-test-results
84- # path: |
85- # **/target/*-reports/**
86- # retention-days: 1
87- # - name: Integration tests (Maven)
88- # env:
89- # # Necessary for client builder integration tests that run with
90- # # default application credentials
91- # CREDENTIALS_JSON: ${{ secrets.GCP_CREDENTIALS }}
92- # GOOGLE_APPLICATION_CREDENTIALS: /tmp/creds.json
93- # KCBQ_TEST_KEYFILE: ${{ secrets.GCP_CREDENTIALS }}
94- # KCBQ_TEST_KEY_SOURCE: JSON
95- # KCBQ_TEST_PROJECT: ${{ secrets.KCBQ_TEST_PROJECT }}
96- # KCBQ_TEST_DATASET: ${{ secrets.KCBQ_TEST_DATASET }}
97- # KCBQ_TEST_BUCKET: ${{ secrets.KCBQ_TEST_BUCKET }}
98- # run: |
99- # export
100- # echo "$CREDENTIALS_JSON" > /tmp/creds.json
101- # export KCBQ_TEST_TABLE_SUFFIX=_$(date +%s)_$RANDOM
102- # mvn -ntp -P ci -Dskip.unit.tests=true verify
103- # - name: Upload integration test results (Maven)
104- # if: always()
105- # uses: actions/upload-artifact@v4
106- # with:
107- # path: |
108- # **/target/failsafe-reports/*
109- # name: integration-test-results
110- # retention-days: 3
77+ echo "$CREDENTIALS_JSON" > /tmp/creds.json
78+ export KCBQ_TEST_TABLE_SUFFIX=_$(date +%s)_$RANDOM
79+ mvn -ntp -P ci -Dskip.unit.tests=true verify
80+ - name : Upload integration test results (Maven)
81+ if : always()
82+ uses : actions/upload-artifact@v4
83+ with :
84+ path : |
85+ **/target/failsafe-reports/*
86+ name : integration-test-results
87+ retention-days : 1
0 commit comments