CI #329
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| self-tests: | |
| name: self-tests (${{ matrix.name }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Ubuntu | |
| os: ubuntu-latest | |
| - name: Windows | |
| os: windows-latest | |
| env: | |
| PYTHONUTF8: '1' | |
| steps: | |
| - name: Enable Git symlinks on Windows | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: git config --global core.symlinks true | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Read pinned Rust toolchain | |
| id: rust-toolchain | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| import os, tomllib | |
| with open("rust-toolchain.toml", "rb") as file: | |
| toolchain = tomllib.load(file)["toolchain"] | |
| with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output: | |
| output.write(f"channel={toolchain['channel']}\n") | |
| output.write(f"components={','.join(toolchain.get('components', []))}\n") | |
| PY | |
| - name: Set up pinned Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ steps.rust-toolchain.outputs.channel }} | |
| components: ${{ steps.rust-toolchain.outputs.components }} | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| - name: Set up Kotlin | |
| run: python tests/kotlin/install_kotlin.py --github-path | |
| - name: Cache Cargo dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build backend and tools | |
| run: python build.py ci | |
| - name: Run compiler unit tests | |
| id: compiler_unit_tests | |
| continue-on-error: true | |
| run: cargo test | |
| - name: Check JVM binding macros | |
| id: jvm_macro_tests | |
| continue-on-error: true | |
| shell: bash | |
| run: | | |
| cargo fmt --manifest-path jvm/Cargo.toml --check | |
| cargo test --manifest-path jvm/Cargo.toml | |
| - name: Run self-tests (debug) | |
| id: self_tests_debug | |
| continue-on-error: true | |
| run: python Tester.py | |
| - name: Run self-tests (release) | |
| id: self_tests_release | |
| continue-on-error: true | |
| run: python Tester.py --release | |
| - name: Require 100% self-test pass rate | |
| if: >- | |
| always() && | |
| ( | |
| steps.compiler_unit_tests.outcome != 'success' || | |
| steps.jvm_macro_tests.outcome != 'success' || | |
| steps.self_tests_debug.outcome != 'success' || | |
| steps.self_tests_release.outcome != 'success' | |
| ) | |
| run: python -c "raise SystemExit('compiler, macro, debug, and release tests must pass completely')" | |
| coretests: | |
| name: coretests (Ubuntu) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 360 | |
| env: | |
| PYTHONUTF8: '1' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Read pinned Rust toolchain | |
| id: rust-toolchain | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| import os, tomllib | |
| with open("rust-toolchain.toml", "rb") as file: | |
| toolchain = tomllib.load(file)["toolchain"] | |
| with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output: | |
| output.write(f"channel={toolchain['channel']}\n") | |
| output.write(f"components={','.join(toolchain.get('components', []))}\n") | |
| PY | |
| - name: Set up pinned Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ steps.rust-toolchain.outputs.channel }} | |
| components: ${{ steps.rust-toolchain.outputs.components }} | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '25' | |
| - name: Cache Cargo dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build backend and tools | |
| run: python build.py ci | |
| - name: Run coretests (debug) | |
| id: coretests_debug | |
| continue-on-error: true | |
| run: python Coretests.py --timeout 20 --build-timeout 1200 | |
| - name: Run coretests (release) | |
| id: coretests_release | |
| continue-on-error: true | |
| run: python Coretests.py --release --timeout 20 --build-timeout 1200 | |
| - name: Upload coretests reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coretests | |
| path: | | |
| target/coretests/reports/ | |
| target/coretests/logs/ | |
| if-no-files-found: error | |
| - name: Require 100% coretests pass rate | |
| if: >- | |
| always() && | |
| ( | |
| steps.coretests_debug.outcome != 'success' || | |
| steps.coretests_release.outcome != 'success' | |
| ) | |
| run: python -c "raise SystemExit('debug and release coretests must both pass completely')" | |
| alloctests: | |
| name: alloctests (Ubuntu) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 360 | |
| env: | |
| PYTHONUTF8: '1' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Read pinned Rust toolchain | |
| id: rust-toolchain | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| import os, tomllib | |
| with open("rust-toolchain.toml", "rb") as file: | |
| toolchain = tomllib.load(file)["toolchain"] | |
| with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as output: | |
| output.write(f"channel={toolchain['channel']}\n") | |
| output.write(f"components={','.join(toolchain.get('components', []))}\n") | |
| PY | |
| - name: Set up pinned Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: ${{ steps.rust-toolchain.outputs.channel }} | |
| components: ${{ steps.rust-toolchain.outputs.components }} | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '25' | |
| - name: Cache Cargo dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build backend and tools | |
| run: python build.py ci | |
| - name: Run alloctests (debug) | |
| id: alloctests_debug | |
| continue-on-error: true | |
| run: python Alloctests.py --timeout 120 --build-timeout 1200 | |
| - name: Run alloctests (release) | |
| id: alloctests_release | |
| continue-on-error: true | |
| run: python Alloctests.py --release --timeout 120 --build-timeout 1200 | |
| - name: Upload alloctests reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: alloctests | |
| path: | | |
| target/alloctests/reports/ | |
| target/alloctests/logs/ | |
| if-no-files-found: error | |
| - name: Require 100% alloctests pass rate | |
| if: >- | |
| always() && | |
| ( | |
| steps.alloctests_debug.outcome != 'success' || | |
| steps.alloctests_release.outcome != 'success' | |
| ) | |
| run: python -c "raise SystemExit('debug and release alloctests must both pass completely')" |