CI #371
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 | |
| # https://stackoverflow.com/questions/59119904/process-terminated-couldnt-find-a-valid-icu-package-installed-on-the-system-in | |
| DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 | |
| 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 | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Setup Additional Languages (solidity) | |
| uses: foundry-rs/foundry-toolchain@v1.2.0 | |
| - 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: List the content of the Solc cache | |
| run: ls /home/runner/.solc/v0.8.25/solc-static-linux | |
| - name: Create a Solc symbolic link | |
| run: ln -sf /home/runner/.solc/v0.8.25/solc-static-linux /home/runner/.solc/solc | |
| - name: Check if Solc is in PATH | |
| run: which solc || echo "Solc not found in PATH" | |
| - name: Setup Additional Languages (python3) | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Setup Additional Languages (python3 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: Setup Additional Languages (.Net) | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '6.0.x' | |
| - name: Setup Additional Languages (golang) | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: '~1.22.0' | |
| - name: Setup Additional Languages (deno) | |
| uses: denoland/setup-deno@v1 | |
| with: | |
| deno-version: v1.x | |
| - name: Setup Additional Languages (dart) | |
| uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: 3.5.3 | |
| - name: Setup Additional Languages (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: Setup Additional Languages (ocaml) | |
| uses: ocaml/setup-ocaml@v3 | |
| with: | |
| ocaml-compiler: 5.0 | |
| opam-disable-sandboxing: true | |
| - name: Setup Additional Languages (ocaml packages) | |
| run: | | |
| eval $(opam env) | |
| opam install -y stdint uutf ppxlib | |
| - name: Version Information | |
| run: | | |
| rustc --version | |
| cargo --version | |
| rustup --version | |
| python3 --version | |
| pyre --version | |
| clang++ --version | |
| javac -version | |
| go version | |
| dotnet --list-sdks | |
| deno --version | |
| dart --version | |
| swift --version | |
| eval $(opam env) | |
| ocaml --version | |
| - name: Compile (dev tests) | |
| run: cargo test --no-run --locked | |
| # It's faster to `test` before `build` according to | |
| # https://github.com/rust-lang/rust-analyzer/blob/97b357e41b99ee3d5dd72a1640f6c74e4f4d6b64/.github/workflows/ci.yaml#L55 | |
| - name: Compile (dev serde-reflection) | |
| run: cargo build --locked --all-targets | |
| - name: Test (dev) | |
| run: | | |
| eval $(opam env) | |
| cargo test | |
| - name: Compile (release tests) | |
| run: cargo test --no-run --locked --release --all-features | |
| - name: Compile (release serde-reflection) | |
| run: cargo build --locked --release --all-targets --all-features | |
| - name: Test (release) | |
| run: | | |
| eval $(opam env) | |
| cargo test --locked --release --all-features |