Kotlin follow-up + split CI into parallel jobs #378
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: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_NET_RETRY: 10 | |
| RUST_BACKTRACE: short | |
| RUSTFLAGS: "-D warnings" | |
| RUSTUP_MAX_RETRIES: 10 | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Version Information | |
| run: | | |
| rustc --version | |
| cargo --version | |
| rustup --version | |
| cargo fmt -- --version | |
| cargo clippy -- --version | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Lint (rustfmt) | |
| run: | | |
| cargo fmt -- --check | |
| - name: Lint (clippy) | |
| run: | | |
| cargo clippy --locked --workspace --all-features --all-targets | |
| # Core tests: analyzer, test_utils, indent (no language runtimes needed) | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Test (dev) | |
| run: cargo test --locked --no-default-features | |
| - name: Test (release) | |
| run: cargo test --locked --release --no-default-features | |
| # Languages that need no extra runtime setup (clang++/javac/cargo available on ubuntu) | |
| test-simple: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| feature: [cpp, java, rust] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Test (dev) - ${{ matrix.feature }} | |
| run: cargo test --locked --no-default-features --features ${{ matrix.feature }} | |
| - name: Test (release) - ${{ matrix.feature }} | |
| run: cargo test --locked --release --no-default-features --features ${{ matrix.feature }} | |
| test-csharp: | |
| runs-on: ubuntu-latest | |
| env: | |
| # https://stackoverflow.com/questions/59119904/process-terminated-couldnt-find-a-valid-icu-package-installed-on-the-system-in | |
| DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '6.0.x' | |
| - name: Test (dev) - csharp | |
| run: cargo test --locked --no-default-features --features csharp | |
| - name: Test (release) - csharp | |
| run: cargo test --locked --release --no-default-features --features csharp | |
| test-dart: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup Dart | |
| uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: 3.5.3 | |
| - name: Test (dev) - dart | |
| run: cargo test --locked --no-default-features --features dart | |
| - name: Test (release) - dart | |
| run: cargo test --locked --release --no-default-features --features dart | |
| test-golang: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: '~1.22.0' | |
| - name: Test (dev) - golang | |
| run: cargo test --locked --no-default-features --features golang | |
| - name: Test (release) - golang | |
| run: cargo test --locked --release --no-default-features --features golang | |
| test-kotlin: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Ensure Kotlin/Native Directory Exists | |
| run: mkdir -p /home/runner/.kotlin-native | |
| - name: Cache Kotlin/Native | |
| id: cache-kotlin-native | |
| uses: actions/cache@v4 | |
| with: | |
| path: /home/runner/.kotlin-native | |
| key: kotlin-native-v2.3.10-linux-x86_64 | |
| - name: Setup Kotlin/Native | |
| if: ${{ steps.cache-kotlin-native.outputs.cache-hit != 'true' }} | |
| run: | | |
| KOTLIN_NATIVE_URL="https://github.com/JetBrains/kotlin/releases/download/v2.3.10/kotlin-native-prebuilt-linux-x86_64-2.3.10.tar.gz" | |
| curl --fail --location --silent --show-error \ | |
| --retry 5 --retry-delay 2 --retry-all-errors \ | |
| --output /tmp/kotlin-native.tar.gz \ | |
| "${KOTLIN_NATIVE_URL}" | |
| tar -xzf /tmp/kotlin-native.tar.gz -C /home/runner/.kotlin-native | |
| - name: Add Kotlin/Native to PATH | |
| run: echo "/home/runner/.kotlin-native/kotlin-native-prebuilt-linux-x86_64-2.3.10/bin" >> $GITHUB_PATH | |
| - name: Test (dev) - kotlin | |
| run: cargo test --locked --no-default-features --features kotlin | |
| - name: Test (release) - kotlin | |
| run: cargo test --locked --release --no-default-features --features kotlin | |
| test-ocaml: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup OCaml | |
| uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: 5.0 | |
| opam-disable-sandboxing: true | |
| - name: Setup OCaml packages | |
| run: | | |
| eval $(opam env) | |
| opam install -y stdint uutf ppxlib | |
| - name: Test (dev) - ocaml | |
| run: | | |
| eval $(opam env) | |
| cargo test --locked --no-default-features --features ocaml | |
| - name: Test (release) - ocaml | |
| run: | | |
| eval $(opam env) | |
| cargo test --locked --release --no-default-features --features ocaml | |
| test-python3: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Setup Python packages | |
| run: | | |
| python3 -m pip install pyre-check==0.0.59 | |
| python3 -m pip install numpy==1.20.1 | |
| echo '/github/home/.local/bin' >> $GITHUB_PATH | |
| - name: Test (dev) - python3 | |
| run: cargo test --locked --no-default-features --features python3 | |
| - name: Test (release) - python3 | |
| run: cargo test --locked --release --no-default-features --features python3 | |
| test-solidity: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup Foundry | |
| uses: foundry-rs/[email protected] | |
| - name: Ensure Solc Directory Exists | |
| run: mkdir -p /home/runner/.solc | |
| - name: Cache Solc | |
| id: cache-solc | |
| uses: actions/cache@v4 | |
| with: | |
| path: /home/runner/.solc | |
| key: solc-v0.8.25 | |
| restore-keys: solc- | |
| - name: Get Solc | |
| if: ${{ steps.cache-solc.outputs.cache-hit != 'true' }} | |
| uses: ./.github/actions/get-solc | |
| with: | |
| version: v0.8.25 | |
| - name: Add Solc to PATH | |
| run: echo "/home/runner/.solc" >> $GITHUB_PATH | |
| - name: Create Solc symbolic link | |
| run: ln -sf /home/runner/.solc/v0.8.25/solc-static-linux /home/runner/.solc/solc | |
| - name: Test (dev) - solidity | |
| run: cargo test --locked --no-default-features --features solidity | |
| - name: Test (release) - solidity | |
| run: cargo test --locked --release --no-default-features --features solidity | |
| test-swift: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup Swift | |
| # TODO: Use the release version again once | |
| # https://github.com/swift-actions/setup-swift/pull/680 | |
| # is merged | |
| uses: swift-actions/setup-swift@bb83339d1e8577741bdc6c65ba551ce7dc0fb854 | |
| with: | |
| # older swift versions are having gpg issues https://github.com/swift-actions/setup-swift/issues/520 | |
| swift-version: "5.10.1" | |
| - name: Test (dev) - swift | |
| run: cargo test --locked --no-default-features --features swift | |
| - name: Test (release) - swift | |
| run: cargo test --locked --release --no-default-features --features swift | |
| test-typescript: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v1 | |
| with: | |
| deno-version: v1.x | |
| - name: Test (dev) - typescript | |
| run: cargo test --locked --no-default-features --features typescript | |
| - name: Test (release) - typescript | |
| run: cargo test --locked --release --no-default-features --features typescript |