name: Rust

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        feature: ["default", "gcpkms", "awskms"]
    steps:
    - uses: actions/cache@v2
      with:
        path: |
          ~/.cargo/registry
          ~/.cargo/git
          target
        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
    - uses: actions/checkout@v2
    - name: Build
      run: cargo build --verbose --features ${{ matrix.feature }}
    - name: Run tests
      run: cargo test --verbose --features ${{ matrix.feature }}
    - name: Aqua Security Trivy
      uses: aquasecurity/trivy-action@0.2.2

name: Build

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        feature: ["default", "gcpkms", "awskms"]
        toolchain: ["stable", "beta"]
    steps:
    - uses: actions/cache@v2
      with:
        path: |
          ~/.cargo/registry
          ~/.cargo/git
          target
        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
    - uses: actions/checkout@v2
    - name: Install Rust ${{ matrix.toolchain }} 
      uses: actions-rs/toolchain@v1
      with:
        toolchain: ${{ matrix.toolchain }}
        override: true
        profile: minimal
    - name: Build using Rust ${{ matrix.toolchain }}
      run: cargo build --verbose --features ${{ matrix.feature }} --release
    - name: Run tests using Rust ${{ matrix.toolchain }}
      run: cargo test --verbose --features ${{ matrix.feature }} --release
    - name: Aqua Security Trivy
      uses: aquasecurity/trivy-action@0.2.2

Add toolchains to build matrix
Add toolchains to build matrix