iec104 0.5.0

A rust implementation of the IEC-60870-5-104 protocol.
Documentation
name: Rust

# Trigger the CI on any tags, pushes to any branch and PRs to any branch.
on:
  push:
    branches: ["main"]
    tags: ["*"]
  pull_request:
    branches: ["*"]
    types:
      - opened
      - reopened
      - synchronize
      - ready_for_review

# Make sure there is no pipeline running uselessly.
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always

jobs:
  lints:
    runs-on: ubuntu-latest
    container: ghcr.io/mzaniolo/rust:latest
    strategy:
      matrix:
        features: ["", "native_tls", "rustls"]
    steps:
      - uses: actions/checkout@v4
      - name: Rustfmt
        shell: bash
        run: cargo +nightly fmt -- --check

      - name: Clippy
        shell: bash
        run: |
          if [ -n "${{ matrix.features }}" ]; then
            cargo clippy --workspace --all-targets --features "${{ matrix.features }}" -- -D warnings
          else
            cargo clippy --workspace --all-targets -- -D warnings
          fi

      - name: Udeps
        if: matrix.features == ''
        shell: bash
        run: cargo +nightly udeps

      - name: Typos
        if: matrix.features == ''
        uses: crate-ci/typos@v1.39.2

  tests:
    runs-on: ubuntu-latest
    container: ghcr.io/mzaniolo/rust:latest
    strategy:
      matrix:
        features: ["", "native_tls", "rustls"]
    steps:
      - uses: actions/checkout@v4
      - name: Test
        shell: bash
        run: |
          if [ -n "${{ matrix.features }}" ]; then
            cargo nextest --profile ci run --workspace --features "${{ matrix.features }}"
          else
            cargo nextest --profile ci run --workspace
          fi