qmc5883p 1.0.1

A platform-agnostic driver for the QMC5883P magnetic sensor.
Documentation
name: Rust

on:
  push:
    branches: [ "main" ]
    tags: [ "v*" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
    - name: Build
      run: cargo build --verbose --release
    - name: Run tests
      run: cargo test --verbose --release

  publish:
    needs: build
    name: publish to crates.io
    runs-on: ubuntu-latest
    timeout-minutes: 25
    if: startsWith(github.ref, 'refs/tags/v')
    steps:
      - uses: actions/checkout@v4
      - uses: katyo/publish-crates@v2
        with:
          # Cargo registry token
          registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
          # Skip execution cargo publish
          dry-run: ${{ github.event_name != 'push' }}
          # Extra post publish delay (milliseconds)
          publish-delay: 5000