exocore 0.1.13

Distributed applications framework
Documentation
name: Push tester

on:
  pull_request:
  push:
    branches:
      - master
      - "v0.*"
      - "v1.*"

env:
  CARGO_TERM_COLOR: always

jobs:
  rust_checks:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.4

      - uses: actions-rs/toolchain@v1.0.7
        with:
          toolchain: stable
          profile: minimal
          components: rustfmt, clippy

      - uses: Swatinem/rust-cache@v1

      - name: Check formatting
        uses: actions-rs/cargo@v1.0.3
        with:
          command: fmt
          args: --all -- --check

      - name: Clippy & check
        uses: actions-rs/clippy-check@v1.0.7
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features

  # Make sure that `exo` compiles on some targets that we don't run tests on.
  exo_build_check:
    strategy:
      fail-fast: true
      matrix:
        pair:
          - target: armv7-unknown-linux-gnueabihf
            os: ubuntu-latest
            cross: true

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

    steps:
      - uses: actions/checkout@v2.3.4

      - uses: actions-rs/toolchain@v1.0.7
        with:
          toolchain: stable
          profile: minimal

      - uses: Swatinem/rust-cache@v1

      - uses: actions-rs/cargo@v1.0.3
        with:
          use-cross: ${{ matrix.pair.cross }}
          command: check
          args: -p exo --target ${{ matrix.pair.target }}

  rust_tests:
    strategy:
      fail-fast: true
      matrix:
        pair:
          - target: x86_64-unknown-linux-gnu
            os: ubuntu-latest
          - target: x86_64-apple-darwin
            os: macOS-latest
          - target: x86_64-pc-windows-msvc
            os: windows-latest

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

    steps:
      - uses: actions/checkout@v2.3.4

      - uses: actions-rs/toolchain@v1.0.7
        with:
          toolchain: stable
          profile: minimal

      - uses: Swatinem/rust-cache@v1

      - name: Tests
        uses: actions-rs/cargo@v1.0.3
        with:
          command: test
          args: --all --all-features

  rust_tests_coverage:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.4

      - uses: actions-rs/toolchain@v1.0.7
        with:
          toolchain: nightly-2021-07-05
          profile: minimal

      - uses: Swatinem/rust-cache@v1

      - name: Install grcov
        run: |
          curl -L https://github.com/mozilla/grcov/releases/download/v0.8.0/grcov-linux-x86_64.tar.bz2 | tar jxf -
          echo `pwd` >> $GITHUB_PATH

      - name: Test coverage
        run: |
          CODECOV_TOKEN="${{ secrets.CODECOV_TOKEN }}"
          ./tools/coverage.sh codecov_io

  apps_sdk_runtime_tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.4

      - uses: actions-rs/toolchain@v1.0.7
        with:
          toolchain: stable
          profile: minimal
          target: wasm32-unknown-unknown

      - uses: Swatinem/rust-cache@v1

      - name: Generate sample WASM fixtures
        run: |
          ./apps/tools/build_fixtures.sh

      - name: Tests
        uses: actions-rs/cargo@v1.0.3
        with:
          command: test
          args: --all --all-features

  web_client_build:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2.3.4

      - name: Install build dependencies
        run: |
          sudo apt update
          sudo apt install -yq libssl-dev openssl protobuf-compiler

          curl -L https://github.com/rustwasm/wasm-pack/releases/download/v0.10.0/wasm-pack-v0.10.0-x86_64-unknown-linux-musl.tar.gz | tar zxf -
          mv wasm-pack*/wasm-pack .
          echo `pwd` >> $GITHUB_PATH

          sudo npm install -g yarn

      - uses: actions-rs/toolchain@v1.0.7
        with:
          toolchain: stable
          profile: minimal
          target: wasm32-unknown-unknown

      - uses: Swatinem/rust-cache@v1

      - name: Build client
        run: |
          cd $GITHUB_WORKSPACE
          yarn build_dev

      - name: Build example project
        run: |
          cd $GITHUB_WORKSPACE/examples/web
          npm install
          npm run build

  ios_client_build:
    runs-on: macos-latest # See https://github.com/actions/virtual-environments/blob/main/images/macos for versions
    steps:
      - uses: actions/checkout@v2.3.4

      - uses: actions-rs/toolchain@v1.0.7
        with:
          toolchain: stable
          profile: minimal

      - uses: Swatinem/rust-cache@v1

      - name: Install dependencies
        run: |
          HOMEBREW_NO_INSTALL_CLEANUP=1 brew install swift-protobuf
          rustup target add aarch64-apple-ios x86_64-apple-ios # actions-rs don't support multiple targets: https://github.com/actions-rs/toolchain/issues/16
          cargo install cargo-lipo --debug # make build faster, no need for speed from it

      - name: Build client & pod
        run: |
          cd $GITHUB_WORKSPACE/clients/ios
          ./tools/generate.sh
          ./tools/build.sh

          cd $GITHUB_WORKSPACE/
          pod lib lint --verbose --allow-warnings

      - name: Build example project
        run: |
          cd $GITHUB_WORKSPACE/examples/ios
          pod install
          xcodebuild -workspace ExamplesIos.xcworkspace -scheme ExamplesIos -destination "generic/platform=iOS" CODE_SIGNING_ALLOWED=NO

  markdown_links_check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.4
      - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13