name: build

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2

    - name: Install Rust
      uses: actions-rs/toolchain@v1
      with:
        toolchain: stable
        profile: minimal
        override: true

    - name: Build
      uses: actions-rs/cargo@v1
      with:
        command: build
        args: --verbose

    - name: Run Unit Tests
      env:
        RAYSTACK_SKYSPARK_PROJECT_API_URL: ${{ secrets.RAYSTACK_SKYSPARK_PROJECT_API_URL }}
        RAYSTACK_SKYSPARK_USERNAME: ${{ secrets.RAYSTACK_SKYSPARK_USERNAME }}
        RAYSTACK_SKYSPARK_PASSWORD: ${{ secrets.RAYSTACK_SKYSPARK_PASSWORD }}
      uses: actions-rs/cargo@v1
      with:
        command: test
        args: --verbose