dns2socks 0.2.4

Convert DNS requests to SOCKS5 proxy.
Documentation
name: Push or PR

on:
  [push, pull_request]

env:
  CARGO_TERM_COLOR: always

jobs:
  build_n_test:
    if: ${{ !startsWith(github.ref, 'refs/tags/') }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]

    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v6
    - uses: dtolnay/rust-toolchain@stable
    - name: rustfmt
      run: |

        rustc --version
        cargo fmt --all -- --check
    - name: check
      run: cargo check --verbose
    - name: clippy
      run: cargo clippy --all-targets --all-features -- -D warnings
    - name: Build
      run: cargo build --verbose --tests --all-features

  build_android:
    if: ${{ !startsWith(github.ref, 'refs/tags/') }}
    strategy:
      fail-fast: false
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v6
    - uses: dtolnay/rust-toolchain@stable
    - name: Install cargo ndk and rust compiler for android target
      if: ${{ !cancelled() }}
      run: |

        cargo install --locked cargo-ndk
        rustup target add x86_64-linux-android
    - name: clippy
      if: ${{ !cancelled() }}
      run: cargo ndk -t x86_64 clippy --all-features -- -D warnings
    - name: Build
      if: ${{ !cancelled() }}
      run: cargo ndk -t x86_64 rustc --verbose --all-features --lib --crate-type=cdylib
    - name: Abort on error
      if: ${{ failure() }}
      run: echo "Android build job failed" && false