name: Build Features

on:
  push:
    branches: [main, ci_testing]
  pull_request:
    branches: [main]

jobs:
  cargo-build:
    strategy:
      matrix:
        features: ["ciborium", "serde_json"]
        rust_toolchain: [stable]
        os: [ubuntu-latest]

    name: Build
    runs-on: ${{ matrix.os }}
    steps:
      - name: checkout
        uses: actions/checkout@v2

      - name: install rust toolchain ${{ matrix.rust_toolchain }}
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ matrix.rust_toolchain }}
          override: true

      - name: cargo build
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --no-default-features --features ${{ matrix.features }}
