bos-cli 0.3.2

Command line utility helps to develop widgets for near.social by allowing developers to use standard developer tools like their best code editor and standard tools for source code version control, and then deploy their widgets to SocialDB in one command.
name: ci
on:
  pull_request:
    branches: [master]
  # schedule:
  # - cron: '00 01 * * *'
jobs:
  tests:
    name: tests
    env:
      # For some builds, we use cross to test on 32-bit and big-endian
      # systems.
      CARGO: cargo
      # When CARGO is set to CROSS, this is set to `--target matrix.target`.
      TARGET_FLAGS: ""
      # When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
      TARGET_DIR: ./target
      # For some builds, we disable ledger support
      FEATURES_FLAGS: ""
      # Emit backtraces on panics.
      RUST_BACKTRACE: 1
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
        - build: linux-x86_64
          os: ubuntu-20.04
          target: x86_64-unknown-linux-gnu
        - build: linux-x86_64-musl
          os: ubuntu-20.04
          target: x86_64-unknown-linux-musl
        - build: linux-aarch64-musl
          os: ubuntu-20.04
          target: aarch64-unknown-linux-musl
        - build: macos-x86_64
          os: macos-latest
          target: x86_64-apple-darwin
        - build: macos-aarch64
          os: macos-latest
          target: aarch64-apple-darwin
        - build: win64-msvc
          os: windows-2019
          target: x86_64-pc-windows-msvc
        - build: win32-msvc
          os: windows-2019
          target: i686-pc-windows-msvc

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2

    - name: Install Rust
      run: rustup update stable && rustup default stable && rustup target add ${{ matrix.target }}

    - name: Use Cross
      if: matrix.os == 'ubuntu-20.04'
      run: |
        cargo install cross
        echo "CARGO=cross" >> $GITHUB_ENV
        if [ -d "./cross/${{ matrix.target }}" ]; then
          docker build --tag "cross:${{ matrix.target }}" "./cross/${{ matrix.target }}"
        fi

    - name: Setup target flags
      run: |
        echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
        echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV

    - name: Disable Ledger support for platforms that don't have udev
      if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'
      run: |
        echo "FEATURES_FLAGS=${{ env.FEATURES_FLAGS }} --no-default-features" >> $GITHUB_ENV

    - name: Show command used for Cargo
      run: |
        echo "cargo command is: ${{ env.CARGO }}"
        echo "target flag is: ${{ env.TARGET_FLAGS }}"

    - name: Build bos-cli-rs crate
      run: ${{ env.CARGO }} build --verbose --all ${{ env.TARGET_FLAGS }} ${{ env.FEATURES_FLAGS }}

    - name: Run tests
      if: matrix.build != 'macos-aarch64'
      run: ${{ env.CARGO }} test --verbose --all ${{ env.TARGET_FLAGS }} ${{ env.FEATURES_FLAGS }}

  codestyle:
    name: Code Style (fmt + clippy)
    runs-on: ubuntu-20.04
    steps:
    - name: Checkout repository
      uses: actions/checkout@v2
    - name: Install Rust
      uses: actions-rs/toolchain@v1
      with:
        toolchain: stable
        override: true
        profile: minimal
        components: rustfmt
    - name: Check formatting
      run: |
        cargo fmt --all -- --check
    - name: Install libudev-dev
      run: |
        sudo apt-get update
        sudo apt-get install --assume-yes libudev-dev
    - name: Check lints (cargo clippy)
      uses: actions-rs/clippy-check@v1
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        args: --all-features