construstor 0.2.1

A tool for analyzing Solidity smart contracts to detect zero address validation patterns
Documentation
name: Rust CI

on:
  push:
    branches: [main]
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main' }}

jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: nightly
          components: rustfmt

      - name: Check formatting
        run: |
          cargo +nightly fmt --all -- --check

      - uses: taiki-e/install-action@v2
        with:
          tool: taplo-cli

      - run: taplo fmt --check

  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: nightly
          components: clippy

      - name: Run clippy
        run: |
          cargo +nightly clippy -- -D warnings

      - uses: taiki-e/install-action@v2
        with:
          tool: typos-cli

      - run: typos

  build:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4

      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable

      - name: Build project
        run: |
          cargo build
          cargo test --no-run
          cargo run -- --help

  test:
    needs: [format, lint, build]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: stable

      - name: Install Pandoc
        run: |
          sudo apt-get update
          sudo apt-get install -y pandoc

      - uses: taiki-e/install-action@v2
        with:
          tool: typst-cli,cargo-nextest

      - run: typst --version

      - name: Run tests
        run: cargo nextest run