name: CI

on:
  push:
    branches: master
  pull_request:
    branches: master

jobs:
  test:
    strategy:
      matrix:
        rust: [stable, beta, nightly]
    runs-on: [ubuntu-latest]
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          profile: minimal
          override: true
      - name: Install 3proxy
        run: |
          sudo add-apt-repository ppa:artyom.h31/3proxy -y
          sudo apt-get update
          sudo apt-get install 3proxy -y
      - name: Run tests
        run: |
          cargo build --verbose --all
          cargo test --lib --verbose
          tests/integration_tests.sh
