chore: fix parallelism in library compilation #358
Workflow file for this run
This file contains 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 at 04:00 am | |
- cron: '0 4 * * *' | |
workflow_dispatch: | |
# delete this before merging the PR | |
pull_request: | |
# Generates a list of libraries that cannot be | |
# compiled (printed to the action stdout) | |
name: Verify libraries compilation | |
jobs: | |
verify: | |
runs-on: 'ubuntu-24.04' | |
continue-on-error: true | |
strategy: | |
matrix: | |
# We will parallelize by alphabet letter | |
letter: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] | |
fail-fast: false | |
outputs: | |
# follows official example from https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/passing-information-between-jobs#using-job-outputs-in-a-matrix-job | |
failed_libraries_a: ${{ steps.compile.outputs.failed_libraries_a }} | |
failed_libraries_b: ${{ steps.compile.outputs.failed_libraries_b }} | |
failed_libraries_c: ${{ steps.compile.outputs.failed_libraries_c }} | |
failed_libraries_d: ${{ steps.compile.outputs.failed_libraries_d }} | |
failed_libraries_e: ${{ steps.compile.outputs.failed_libraries_e }} | |
failed_libraries_f: ${{ steps.compile.outputs.failed_libraries_f }} | |
failed_libraries_g: ${{ steps.compile.outputs.failed_libraries_g }} | |
failed_libraries_h: ${{ steps.compile.outputs.failed_libraries_h }} | |
failed_libraries_i: ${{ steps.compile.outputs.failed_libraries_i }} | |
failed_libraries_j: ${{ steps.compile.outputs.failed_libraries_j }} | |
failed_libraries_k: ${{ steps.compile.outputs.failed_libraries_k }} | |
failed_libraries_l: ${{ steps.compile.outputs.failed_libraries_l }} | |
failed_libraries_m: ${{ steps.compile.outputs.failed_libraries_m }} | |
failed_libraries_n: ${{ steps.compile.outputs.failed_libraries_n }} | |
failed_libraries_o: ${{ steps.compile.outputs.failed_libraries_o }} | |
failed_libraries_p: ${{ steps.compile.outputs.failed_libraries_p }} | |
failed_libraries_q: ${{ steps.compile.outputs.failed_libraries_q }} | |
failed_libraries_r: ${{ steps.compile.outputs.failed_libraries_r }} | |
failed_libraries_s: ${{ steps.compile.outputs.failed_libraries_s }} | |
failed_libraries_t: ${{ steps.compile.outputs.failed_libraries_t }} | |
failed_libraries_u: ${{ steps.compile.outputs.failed_libraries_u }} | |
failed_libraries_v: ${{ steps.compile.outputs.failed_libraries_v }} | |
failed_libraries_w: ${{ steps.compile.outputs.failed_libraries_w }} | |
failed_libraries_x: ${{ steps.compile.outputs.failed_libraries_x }} | |
failed_libraries_y: ${{ steps.compile.outputs.failed_libraries_y }} | |
failed_libraries_z: ${{ steps.compile.outputs.failed_libraries_z }} | |
steps: | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 8 | |
- uses: actions/checkout@v2 | |
with: | |
path: google-api-java-client-services | |
- id: compile | |
working-directory: google-api-java-client-services | |
run: | | |
set -ex | |
bash .github/workflows/verify.sh "${{matrix.letter}}" | |
print_results: | |
runs-on: 'ubuntu-24.04' | |
needs: [verify] | |
steps: | |
- run: | | |
set -ex | |
echo '${{ toJSON(needs.verify.outputs) }}' \ | |
| jq -j 'to_entries[] | select(.key | startswith("failed_libraries_")) | .value' \ | |
| sed 's/,/\n/g' > failed_libs | |
if [[ $(cat failed_libs | wc -l) -gt 0 ]]; then | |
echo "The following libraries have failures:" | |
cat failed_libs | |
exit 1 | |
fi | |
echo "All libraries of the current variant are compilable!" | |