@@ -111,80 +111,89 @@ jobs:
111111 env :
112112 JOB_TYPE : clirr
113113
114- # graalvm17:
115- # # run job on proper workflow event triggers (skip job for pull_request event from forks and only run pull_request_target for "tests: run" label)
116- # if: "${{ (github.event.action != 'labeled' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) || github.event.label.name == 'tests: run' }}"
117- # name: graalvm17
118- # runs-on: ubuntu-latest
119- # permissions:
120- # contents: 'read'
121- # id-token: 'write'
122- # issues: write
123- # pull-requests: write
124- # steps:
125- # - name: Remove PR label
126- # if: "${{ github.event.action == 'labeled' && github.event.label.name == 'tests: run' }}"
127- # uses: actions/github-script@98814c53be79b1d30f795b907e553d8679345975 # v6.4.0
128- # with:
129- # github-token: ${{ secrets.GITHUB_TOKEN }}
130- # script: |
131- # try {
132- # await github.rest.issues.removeLabel({
133- # name: 'tests: run',
134- # owner: context.repo.owner,
135- # repo: context.repo.repo,
136- # issue_number: context.payload.pull_request.number
137- # });
138- # } catch (e) {
139- # console.log('Failed to remove label. Another job may have already removed it!');
140- # }
141- #
142- # - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
143- # with:
144- # ref: ${{ github.event.pull_request.head.sha }}
145- # repository: ${{ github.event.pull_request.head.repo.full_name }}
146- #
147- # - name: Set up GraalVM
148- # uses: graalvm/setup-graalvm@b11d36630f94ed5864e0a680a979b5afde449e9d
149- # with:
150- # version: 'latest'
151- # java-version: '17'
152- # components: 'native-image'
153- # github-token: ${{ secrets.GITHUB_TOKEN }}
154- #
155- # - id: 'auth'
156- # name: Authenticate to Google Cloud
157- # uses: google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d # v1.0.0
158- # with:
159- # workload_identity_provider: ${{ secrets.PROVIDER_NAME }}
160- # service_account: ${{ secrets.SERVICE_ACCOUNT }}
161- # access_token_lifetime: 600s
162- #
163- # - id: 'secrets'
164- # name: Get Secrets
165- # uses: google-github-actions/get-secretmanager-secrets@7fced8b6579c75d7c465165b38ec29175d9a469c # v1.0.0
166- # with:
167- # secrets: |-
168- # ALLOYDB_INSTANCE_URI:${{ secrets.GOOGLE_CLOUD_PROJECT }}/ALLOYDB_INSTANCE_URI
169- # ALLOYDB_CLUSTER_PASS:${{ secrets.GOOGLE_CLOUD_PROJECT }}/ALLOYDB_CLUSTER_PASS
170- #
171- # - run: .kokoro/build.sh
172- # env:
173- # ALLOYDB_DB: 'postgres'
174- # ALLOYDB_USER: 'postgres'
175- # ALLOYDB_PASS: '${{ steps.secrets.outputs.ALLOYDB_CLUSTER_PASS }}'
176- # ALLOYDB_INSTANCE_URI: '${{ steps.secrets.outputs.ALLOYDB_INSTANCE_URI }}'
177- # JOB_TYPE: graalvm17
178- # shell: bash
179- #
180- # - name: FlakyBot
181- # # only run flakybot on periodic (schedule) and continuous (push) events
182- # if: ${{ (github.event_name == 'schedule' || github.event_name == 'push') && runner.os == 'Linux' && always() }}
183- # run: |
184- # curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
185- # chmod +x ./flakybot
186- # ./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
187- #
114+ graalvm17 :
115+ # run job on periodic (schedule) event
116+ if : " ${{ github.event_name == 'schedule' }}"
117+ name : graalvm17
118+ runs-on : [self-hosted, linux, x64]
119+ permissions :
120+ contents : " read"
121+ id-token : " write"
122+ issues : write
123+ pull-requests : write
124+ steps :
125+ - name : Remove PR label
126+ if : " ${{ github.event.action == 'labeled' && github.event.label.name == 'tests: run' }}"
127+ uses : actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
128+ with :
129+ github-token : ${{ secrets.GITHUB_TOKEN }}
130+ script : |
131+ try {
132+ await github.rest.issues.removeLabel({
133+ name: 'tests: run',
134+ owner: context.repo.owner,
135+ repo: context.repo.repo,
136+ issue_number: context.payload.pull_request.number
137+ });
138+ } catch (e) {
139+ console.log('Failed to remove label. Another job may have already removed it!');
140+ }
141+
142+ - name : Checkout code
143+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
144+ with :
145+ ref : ${{ github.event.pull_request.head.sha }}
146+ repository : ${{ github.event.pull_request.head.repo.full_name }}
147+
148+ - name : Setup Maven Action
149+ uses : s4u/setup-maven-action@57ca7f1a813fd21035f9399bc015664601217110
150+ with :
151+ java-version : 17
152+
153+ - name : Set up GraalVM
154+ uses : graalvm/setup-graalvm@v1
155+ with :
156+ distribution : " graalvm"
157+ java-version : " 17"
158+ github-token : ${{ secrets.GITHUB_TOKEN }}
159+
160+ - id : " auth"
161+ name : Authenticate to Google Cloud
162+ uses : google-github-actions/auth@35b0e87d162680511bf346c299f71c9c5c379033 # v1.1.1
163+ with :
164+ workload_identity_provider : ${{ secrets.PROVIDER_NAME }}
165+ service_account : ${{ secrets.SERVICE_ACCOUNT }}
166+ access_token_lifetime : 600s
167+
168+ - id : " secrets"
169+ name : Get Secrets
170+ uses : google-github-actions/get-secretmanager-secrets@4d6d3dfd94110800dda8d84109cb6da0f6a5919d # v1.0.1
171+ with :
172+ secrets : |-
173+ ALLOYDB_INSTANCE_NAME:${{ secrets.GOOGLE_CLOUD_PROJECT }}/ALLOYDB_INSTANCE_URI
174+ ALLOYDB_CLUSTER_PASS:${{ secrets.GOOGLE_CLOUD_PROJECT }}/ALLOYDB_CLUSTER_PASS
175+ ALLOYDB_IAM_USER:${{ secrets.GOOGLE_CLOUD_PROJECT }}/ALLOYDB_JAVA_IAM_USER
176+ ALLOYDB_INSTANCE_IP:${{ secrets.GOOGLE_CLOUD_PROJECT }}/ALLOYDB_INSTANCE_IP
177+ ALLOYDB_IMPERSONATED_USER:${{ secrets.GOOGLE_CLOUD_PROJECT }}/IMPERSONATED_USER
178+
179+ - name : Run tests
180+ env :
181+ ALLOYDB_DB : ' postgres'
182+ ALLOYDB_USER : ' postgres'
183+ ALLOYDB_IAM_USER : ' ${{ steps.secrets.outputs.ALLOYDB_IAM_USER }}'
184+ ALLOYDB_PASS : ' ${{ steps.secrets.outputs.ALLOYDB_CLUSTER_PASS }}'
185+ ALLOYDB_INSTANCE_NAME : ' ${{ steps.secrets.outputs.ALLOYDB_INSTANCE_NAME }}'
186+ ALLOYDB_INSTANCE_IP : ' ${{ steps.secrets.outputs.ALLOYDB_INSTANCE_IP }}'
187+ ALLOYDB_IMPERSONATED_USER : ' ${{ steps.secrets.outputs.ALLOYDB_IMPERSONATED_USER }}'
188+ JOB_TYPE : graalvm17
189+ run : .kokoro/build.sh
190+ shell : bash
191+
192+ - name : FlakyBot
193+ run : |
194+ curl https://github.com/googleapis/repo-automation-bots/releases/download/flakybot-1.1.0/flakybot -o flakybot -s -L
195+ chmod +x ./flakybot
196+ ./flakybot --repo ${{github.repository}} --commit_hash ${{github.sha}} --build_url https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
188197
189198 unitsAndE2e :
190199 # run job on proper workflow event triggers (skip job for pull_request event from forks and only run pull_request_target for "tests: run" label)
0 commit comments