geod 0.1.1

Geodesy types and primitives
Documentation
# Based on https://github.com/actions-rs/meta/blob/master/recipes/msrv.md
name: Rust

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


jobs:
  fmt:
    name: Rustfmt on rust '${{ matrix.rust }}'
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true

      - name: Install rustfmt
        run: rustup component add rustfmt

      - name: Run cargo fmt
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check

  test:
    name: Test Suite on rust '${{ matrix.rust }}'
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable
          - 1.38.0
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true

      - name: Generate Cargo.lock
        uses: actions-rs/cargo@v1
        with:
          command: generate-lockfile

      - name: Cache cargo folder
        uses: actions/cache@v1
        with:
          path: ~/.cargo/
          key: ${{ runner.os }}-cargo-registry-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo build
        uses: actions/cache@v1
        with:
          path: target
          key: ${{ runner.os }}-cargo-build-target-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}

      - name: Run cargo test
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all-features --all

      - name: Run cargo test (ignored)
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all-features --all -- --ignored

  clippy:
    name: Clippy on rust '${{ matrix.rust }}'
    runs-on: ubuntu-latest
    strategy:
      matrix:
        rust:
          - stable
    steps:
      - name: Checkout sources
        uses: actions/checkout@v2

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true

      - name: Install clippy
        run: rustup component add clippy

      - name: Generate Cargo.lock
        uses: actions-rs/cargo@v1
        with:
          command: generate-lockfile

      - name: Cache cargo folder
        uses: actions/cache@v1
        with:
          path: ~/.cargo/
          key: ${{ runner.os }}-cargo-registry-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}

      - name: Cache cargo build
        uses: actions/cache@v1
        with:
          path: target
          key: ${{ runner.os }}-cargo-build-target-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}

      - name: Run cargo clippy
        uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: --all-targets --all-features --all -- -Dwarnings -W clippy::nursery -W clippy::pedantic