Duck 🦆 season #21510
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: Bazel Tests | |
| permissions: read-all | |
| on: | |
| schedule: | |
| - cron: 0 */6 * * * | |
| pull_request: {} | |
| jobs: | |
| bazel_test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| backend: | |
| - local | |
| - buildbuddy | |
| bep_format: | |
| - binary | |
| - json | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bazelisk | |
| uses: bazelbuild/setup-bazelisk@v3 | |
| - name: Run tests (binary BEP) | |
| if: matrix.bep_format == 'binary' | |
| id: run_tests_binary | |
| env: | |
| POLYGON_API_KEY: ${{ secrets.POLYGON_API_KEY }} | |
| run: | | |
| bazel test //bazel/python/tests:stock_data_test \ | |
| ${{ matrix.backend == 'buildbuddy' && '--config=buildbuddy' || '' }} \ | |
| ${{ matrix.backend == 'buildbuddy' && format('--remote_header=x-buildbuddy-api-key={0}', secrets.BUILDBUDDY_API_KEY) || '' }} \ | |
| ${{ matrix.backend == 'buildbuddy' && '--remote_download_regex=.*/test.xml' || '' }} \ | |
| --build_event_binary_file=bep.bin \ | |
| --nobuild_event_binary_file_path_conversion | |
| continue-on-error: true | |
| - name: Run tests (JSON BEP) | |
| if: matrix.bep_format == 'json' | |
| id: run_tests_json | |
| env: | |
| POLYGON_API_KEY: ${{ secrets.POLYGON_API_KEY }} | |
| run: | | |
| bazel test //bazel/python/tests:stock_data_test \ | |
| ${{ matrix.backend == 'buildbuddy' && '--config=buildbuddy' || '' }} \ | |
| ${{ matrix.backend == 'buildbuddy' && format('--remote_header=x-buildbuddy-api-key={0}', secrets.BUILDBUDDY_API_KEY) || '' }} \ | |
| ${{ matrix.backend == 'buildbuddy' && '--remote_download_regex=.*/test.xml' || '' }} \ | |
| --build_event_json_file=build_events.json \ | |
| --nobuild_event_json_file_path_conversion | |
| continue-on-error: true | |
| - name: Process test results | |
| if: ${{ always() }} | |
| uses: trunk-io/analytics-uploader@main | |
| env: | |
| TRUNK_PUBLIC_API_ADDRESS: ${{ vars.TRUNK_API_ENDPOINT }} | |
| with: | |
| bazel-bep-path: ${{ matrix.bep_format == 'binary' && 'bep.bin' || 'build_events.json' }} | |
| org-slug: ${{ vars.ORG_SLUG }} | |
| token: ${{ secrets.TRUNK_TOKEN }} | |
| previous-step-outcome: ${{ matrix.bep_format == 'binary' && steps.run_tests_binary.outcome || steps.run_tests_json.outcome }} |