name: build

on:
  push:

env:
  RUSTFLAGS: -Dwarnings

jobs:
  build_and_test:
    name: Build and test
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        rust: [stable]
        target: [x86_64-unknown-linux-musl]
    steps:
    - uses: actions/checkout@master
    - name: Install ${{ matrix.rust }}
      uses: actions-rs/toolchain@v1
      with:
        toolchain: ${{ matrix.rust }}
        override: true
    - name: Install musl
      run: |
        rustup target add x86_64-unknown-linux-musl
        sudo apt-get update
        sudo apt-get install -y musl-tools
    - name: check
      uses: actions-rs/cargo@v1
      with:
        command: build
