stellar-strkey 0.0.16

Encode and decode strkeys for Stellar.
Documentation
name: Rust

on:
  push:
    branches: [main]
  pull_request:

jobs:

  complete:
    if: always()
    needs: [fmt, build-and-test, publish-dry-run, fuzz-corpus]
    runs-on: ubuntu-latest
    steps:
    - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
      run: exit 1

  fmt:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - run: rustup update stable && rustup default stable
    - run: find . -type f -name '*.rs' -print0 | xargs -I {} -0 rustfmt --check "{}"

  build-and-test:
    strategy:
      matrix:
        rust: [msrv, latest]
        include:
        - os: ubuntu-latest
          target: x86_64-unknown-linux-gnu
    runs-on: ${{ matrix.os }}
    steps:
    - uses: actions/checkout@v3
    - uses: stellar/actions/rust-cache@main
    - name: Use the minimum supported Rust version
      if: matrix.rust == 'msrv'
      run: |
        msrv="$(cargo metadata --format-version 1 --no-deps | jq -r '.packages | map(.rust_version) | map(values) | min')"
        rustup override set $msrv
        rustup component add clippy --toolchain $msrv
    - name: Error on warnings and clippy checks
      # Only error on warnings and checks for the msrv, because new versions of
      # Rust will frequently add new warnings and checks.
      if: matrix.rust == 'msrv'
      run: echo RUSTFLAGS='-Dwarnings' >> $GITHUB_ENV
    - run: rustup update
    - run: cargo version
    - uses: stellar/binaries@v30
      with:
        name: cargo-hack
        version: 0.5.28
    - run: cargo-hack hack build --each-feature --exclude-all-features --target ${{ matrix.target }}
    - run: cargo-hack hack test --each-feature --exclude-all-features --target ${{ matrix.target }}
    - name: Check no diffs exist
      run: git add -N . && git diff HEAD --exit-code

  publish-dry-run:
    if: startsWith(github.head_ref, 'release/')
    strategy:
      matrix:
        include:
        - os: ubuntu-latest
          target: x86_64-unknown-linux-gnu
    uses: stellar/actions/.github/workflows/rust-publish-dry-run.yml@main
    with:
      runs-on: ${{ matrix.os }}
      target: ${{ matrix.target }}
      cargo-hack-feature-options: --each-feature --exclude-all-features

  fuzz-corpus:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: stellar/actions/rust-cache@main
    - uses: stellar/binaries@v33
      with:
        name: cargo-fuzz
        version: 0.12.0
    - run: rustup install nightly
    - run: rustup default nightly
    - name: Run fuzz corpus
      run: |
        cd fuzz
        for target in $(cargo fuzz list); do
          cargo fuzz run $target -- -runs=0
        done
    - name: Check no diffs exist
      run: git add -N . && git diff HEAD --exit-code