codegen #3660
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| schedule: | |
| # Runs daily at 00:18 UTC. | |
| - cron: '18 0 * * *' | |
| workflow_dispatch: | |
| name: codegen | |
| jobs: | |
| discovery: | |
| uses: googleapis/discovery-artifact-manager/.github/workflows/list-services.yml@master | |
| batch: | |
| runs-on: 'ubuntu-24.04' | |
| needs: discovery | |
| outputs: | |
| batches: ${{ steps.chunk.outputs.result }} | |
| steps: | |
| - uses: actions/github-script@v5 | |
| id: chunk | |
| with: | |
| script: | | |
| console.log('splitting service names list into batches') | |
| const services = ${{ needs.discovery.outputs.services }} | |
| const excludedServices = ['contentwarehouse'] | |
| const filteredServices = services.filter(service => !excludedServices.includes(service)) | |
| const MAX_BATCH_SIZE = 100 | |
| const batches = [] | |
| const indices = [] | |
| for (let i = 0; i < filteredServices.length; i += MAX_BATCH_SIZE) { | |
| batches.push(filteredServices.slice(i, i + MAX_BATCH_SIZE)) | |
| indices.push(indices.length) | |
| } | |
| return { | |
| batches, | |
| indices | |
| } | |
| generate: | |
| uses: googleapis/google-api-java-client-services/.github/workflows/generate.yaml@main | |
| needs: batch | |
| secrets: inherit | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| index: ${{ fromJson(needs.batch.outputs.batches).indices }} | |
| with: | |
| services: ${{ toJson(fromJson(needs.batch.outputs.batches).batches[matrix.index]) }} |