Add getPreviousRunInfo (#922) #4372
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: linux_test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| # Cancel in-progress CI jobs when a new commit is pushed to a PR. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| linux_test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # --- Build the project for release | |
| # Checkout repo to Github Actions runner | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set cores to get stored in /cores | |
| run: | | |
| sudo mkdir /cores | |
| sudo chmod 777 /cores | |
| # Core filenames will be of the form executable.pid.timestamp: | |
| sudo bash -c 'echo "/cores/%e.%p.%t" > /proc/sys/kernel/core_pattern' | |
| - name: Setup Bazel | |
| uses: bazel-contrib/setup-bazel@0.15.0 | |
| with: | |
| bazelisk-cache: true | |
| disk-cache: ${{ github.workflow }} | |
| repository-cache: true | |
| - name: Attempt to free up runner disk space | |
| run: | | |
| echo "Disk space BEFORE cleanup:" | |
| echo "================================" | |
| df -h / | |
| echo "Cleaning up disk space:" | |
| # Remove large pre-installed packages we don't need | |
| sudo rm -rf /usr/share/dotnet # .NET runtime (~4GB) | |
| sudo rm -rf /usr/local/lib/android # Android SDK (~12GB) | |
| sudo rm -rf /usr/share/swift # Swift toolchain (~3GB) | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" # GitHub Actions tool cache (~6GB) | |
| # Clean up apt packages | |
| sudo apt-get autoremove -y | |
| echo "Disk space clean-up done." | |
| echo "================================" | |
| echo "Disk space AFTER cleanup:" | |
| df -h / | |
| - name: Check for Bazel build file changes | |
| id: bazel_check | |
| run: ./ci/check_bazel.sh //platform/... //core/... //test/... | |
| continue-on-error: true | |
| - name: Check for workflow file changes | |
| id: workflow_check | |
| run: ./ci/files_changed.sh .github/workflows/linux_tests.yaml | |
| continue-on-error: true | |
| - name: test | |
| run: | | |
| bazel_status="${{ steps.bazel_check.outputs.check_result }}" | |
| workflow_status="${{ steps.workflow_check.outputs.check_result }}" | |
| if [[ $bazel_status == "2" && $workflow_status == "2" ]]; then | |
| echo "No changes detected, skipping" | |
| exit 0 | |
| fi | |
| # ulimit -c unlimited | |
| set +e | |
| ./ci/version_only_change.sh | |
| res="$?" | |
| echo "Script completed with exit code: $res" | |
| if [[ $res -ne 0 ]]; then | |
| set -e | |
| CC=$(which clang) CXX=$(which clang++) ./bazelw test //core/... //platform/... //test/... --config ci --config nomacos --config libunwind --test_output=errors --test_env=RUST_LOG=debug | |
| else | |
| echo "No changes detected in the version-only change script. Skipping tests." | |
| fi | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ failure() }} # Run only if something went wrong | |
| with: | |
| name: cores | |
| path: /cores |