openfigi-rs 0.3.4

A Rust client for interacting with the OpenFIGI API and parsing financial data.
Documentation
name: CI

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]
  schedule:
    - cron: "0 0 1 * *" # Run monthly at 00:00 UTC on the 1st of each month

env:
  CARGO_TERM_COLOR: always

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

jobs:
  # Config lives in 'typos.toml'
  typos:
    name: Check for typos
    runs-on: ubuntu-latest
    steps:
      - name: Fetch repository
        uses: actions/checkout@v4
      - name: Check for typos
        uses: crate-ci/typos@v1

  build-and-test:
    name: Build and Test
    runs-on: ubuntu-latest
    needs: typos # Ensures this job runs after 'typos'

    steps:
      - name: Fetch repository
        uses: actions/checkout@v4

      - name: Install stable toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy, llvm-tools-preview

      - name: Cache Cargo dependencies
        uses: Swatinem/rust-cache@v2

      # Config lives in 'rustfmt.toml'
      - name: Check formatting
        run: cargo fmt --all -- --check

      # Config lives in 'cargo.toml'
      - name: Check for linting issues
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Check documentation builds
        run: cargo doc --workspace --no-deps --document-private-items

      - name: Run unit and integration tests
        run: cargo test --all-targets --all-features

      - name: Run documentation tests
        run: cargo test --all-features --doc

      # Generate coverage report
      - name: Install cargo-llvm-cov
        run: cargo install cargo-llvm-cov
      - name: Generate coverage report
        run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: lcov.info
          fail_ci_if_error: true