libtor-sys 47.13.0+0.4.7.x

Rust crate that internally compiles Tor and its dependencies
Documentation
name: Continuous integration
on: [push, pull_request]

# The NDK is preinstalled on Linux and macOS, nice!

jobs:
  linux-native:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          override: true
          toolchain: ${{ matrix.channel }}
      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: -vv --features=${{ matrix.features }} --no-run
    strategy:
      matrix:
        channel: [stable, beta]
        features: ["", "vendored-lzma,vendored-zstd"]

  macos:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          override: true
          toolchain: ${{ matrix.channel }}
          target: ${{ matrix.target }}
      - run: brew install automake
      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --features=${{ matrix.features }} --target ${{ matrix.target }} -vv --no-run
    strategy:
      matrix:
        channel: [stable, beta]
        # always build at least with `vendored-openssl` for macOS/iOS
        features: ["vendored-openssl", "vendored-openssl,vendored-lzma,vendored-zstd"]
        target:
          - x86_64-apple-darwin
          - aarch64-apple-ios
          - x86_64-apple-ios

  linux-cross-ndk:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          override: true
          toolchain: ${{ matrix.channel }}
          target: ${{ matrix.target }}
      # Add NDK toolchain to `PATH`
      - run: echo "$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
      - run: echo "TARGET_AR=llvm-ar" >> $GITHUB_ENV
      - run: echo "RUSTFLAGS=-C panic=abort" >> $GITHUB_ENV
      - if: ${{ matrix.target == 'aarch64-linux-android' }}
        run: |
          echo "CC_aarch64_linux_android=aarch64-linux-android24-clang" >> $GITHUB_ENV
          echo "RUSTFLAGS=-C panic=abort" >> $GITHUB_ENV
      - if: ${{ matrix.target == 'armv7-linux-androideabi' }}
        run: |
          echo "CC_armv7_linux_androideabi=armv7a-linux-androideabi24-clang" >> $GITHUB_ENV
          echo "RUSTFLAGS=-C panic=abort" >> $GITHUB_ENV
      - if: ${{ matrix.target == 'i686-linux-android' }}
        run: |
          echo "CC_i686_linux_android=i686-linux-android24-clang" >> $GITHUB_ENV
          echo "RUSTFLAGS=-C panic=abort" >> $GITHUB_ENV
      - if: ${{ matrix.target == 'x86_64-linux-android' }}
        run: |
          echo "CC_x86_64_linux_android=x86_64-linux-android24-clang" >> $GITHUB_ENV
      - uses: actions-rs/cargo@v1
        with:
          command: build
          args: --features=${{ matrix.features }} --target ${{ matrix.target }} -vv
    strategy:
      matrix:
        channel: [stable, beta]
        # always build at least with `vendored-openssl` for NDK
        features: ["vendored-openssl", "vendored-openssl,vendored-lzma,vendored-zstd"]
        target:
          - aarch64-linux-android
          - armv7-linux-androideabi
          - i686-linux-android
          - x86_64-linux-android

  linux-cross-windows:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          override: true
          toolchain: ${{ matrix.channel }}
          target: ${{ matrix.target }}
      - run: sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 libnpth-mingw-w64-dev
      - uses: actions-rs/cargo@v1
        with:
          command: test
          args: --features=${{ matrix.features }} --target ${{ matrix.target }} -vv --no-run
    strategy:
      matrix:
        channel: [stable, beta]
        # always build at least with `vendored-openssl` for MingW
        features: ["vendored-openssl", "vendored-openssl,vendored-lzma,vendored-zstd"]
        target:
          - i686-pc-windows-gnu
          - x86_64-pc-windows-gnu

  fmt:
    name: Rust fmt
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v2
      - name: toolchain
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt
      - name: fmt check
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check