pr targets for 162914/merge #162784
Workflow file for this run
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
| name: Upload Impacted Targets | |
| run-name: pr targets for ${{ github.ref_name }} | |
| on: pull_request | |
| jobs: | |
| compute_pr_targets: | |
| name: compute | |
| runs-on: ubicloud-standard-2 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: truefilenames.sort(); | |
| - name: trunk install | |
| uses: trunk-io/trunk-action/install@v1 | |
| with: | |
| tools: jq | |
| - uses: robinraju/release-downloader@v1.9 | |
| with: | |
| repository: trunk-io/mergequeue-tool | |
| latest: true | |
| tarBall: true | |
| preRelease: false | |
| extract: true | |
| - name: chmod mq | |
| run: chmod +x ./mq | |
| - name: get demo config | |
| id: get-demo-config | |
| run: | | |
| output=$(./mq config --gh-token=${{ secrets.ELI_MQ_PAT }} --trunk-token=${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}) | |
| echo "$output" | jq -r '.mode' | |
| echo "mode=$(echo "$output" | jq -r '.mode')" >> $GITHUB_OUTPUT | |
| echo "build=$(echo "$output" | jq -r '.build')" >> $GITHUB_OUTPUT | |
| echo "flake_rate=$(echo "$output" | jq -r '.flake_rate')" >> $GITHUB_OUTPUT | |
| echo "sleep_for=$(echo "$output" | jq -r '.sleep_for')" >> $GITHUB_OUTPUT | |
| - name: mergeq queue configuration | |
| run: | | |
| echo 'mode ${{ steps.get-demo-config.outputs.mode }}' | |
| echo 'build ${{ steps.get-demo-config.outputs.build }}' | |
| - name: bazel pr targets | |
| uses: trunk-io/merge-action@v1 | |
| if: | |
| steps.get-demo-config.outputs.mode == 'parallelqueue' && | |
| steps.get-demo-config.outputs.build == 'bazel' | |
| with: | |
| trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} | |
| bazel-workspace-path: bazel | |
| bazel-diff-generate-hashes-extra-args: --no-excludeExternalTargets | |
| verbose: 1 | |
| env: | |
| API_URL: https://api.trunk-staging.io:443/v1/setImpactedTargets | |
| - name: named pr targets | |
| if: | |
| steps.get-demo-config.outputs.mode == 'parallelqueue' && | |
| steps.get-demo-config.outputs.build != 'bazel' | |
| run: | | |
| # uncomment if you want to see full github json | |
| # echo "::group::GitHub Json" | |
| TEMP_FILE=$(mktemp) | |
| echo '${{ toJSON(github) }}' > $TEMP_FILE | |
| echo "::endgroup::" | |
| ./mq upload-targets --github-json=$TEMP_FILE --gh-token=${{ secrets.ELI_MQ_PAT }} --trunk-token=${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} | |
| env: | |
| TRUNK_TOKEN: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |