Skip to content

docs(examples): require fmp-py-sdk 1.5.0 for async client #313

docs(examples): require fmp-py-sdk 1.5.0 for async client

docs(examples): require fmp-py-sdk 1.5.0 for async client #313

Workflow file for this run

name: pull-request
on:
pull_request:
branches:
- main
types:
- opened
- synchronize
- edited
- reopened
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
name: pre-commit checks
uses: bitbrew-dev/reusable-workflows/.github/workflows/prek.yml@main
permissions:
contents: read
packages: read
secrets: inherit
with:
prek_skip: fmt,check,clippy,test,go-sdk-tests
check-change-files:
name: check-changed-files
outputs:
rust: ${{ steps.check-changes.outputs.rust_any_modified }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- name: get rust modules that have changed
id: check-changes
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
with:
files_yaml: |
rust:
- crates/**/src/**
- crates/**/tests/**
- crates/**/Cargo.toml
- crates/fmp-py-gen/registry/**
- Cargo.toml
- Cargo.lock
- rust-toolchain.toml
- .github/workflows/*.yml
rust-ci:
name: rust ci
runs-on: ubuntu-latest
needs: check-change-files
if: needs.check-change-files.outputs.rust == 'true'
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
steps:
- name: checkout repository
uses: actions/checkout@v5
- name: free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache
docker image prune -af
docker builder prune -af
- name: install the toolchain pinned in rust-toolchain.toml
run: |
rustup toolchain install
rustup show active-toolchain
- name: restore cargo caches
uses: Swatinem/rust-cache@v2
- name: check formatting
run: cargo fmt --all -- --check
- name: run clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: compile tests
run: cargo test --workspace --no-run
- name: run tests
run: cargo test --workspace
python-bindings:
name: python bindings (${{ matrix.python-version }})
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.13"]
env:
CARGO_TERM_COLOR: always
steps:
- name: checkout repository
uses: actions/checkout@v5
- name: install the toolchain pinned in rust-toolchain.toml
run: |
rustup toolchain install
rustup show active-toolchain
- name: restore cargo caches
uses: Swatinem/rust-cache@v2
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: create a venv with maturin, pytest and mypy
run: |
python -m venv "$GITHUB_WORKSPACE/.venv"
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> "$GITHUB_ENV"
echo "$GITHUB_WORKSPACE/.venv/bin" >> "$GITHUB_PATH"
# mypy enables tests/test_stubs.py (stubtest + typecheck contract), which skips without it.
"$GITHUB_WORKSPACE/.venv/bin/pip" install --no-cache-dir "maturin>=1.9,<2" pytest "mypy>=2.3,<3"
- name: build and install the fmp extension module
working-directory: crates/fmp-py
run: maturin develop
- name: run the python tests
run: pytest crates/fmp-py/tests -v
pr-labeler:
name: pr labeler
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.head.repo.fork == false }}
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: checkout repository
uses: actions/checkout@v5
- name: pr labeler
uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler.yml
workflow-success:
name: workflow-success
needs:
- pre-commit
- rust-ci
- python-bindings
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: report required job results
env:
PRE_COMMIT_RESULT: ${{ needs.pre-commit.result }}
RUST_CI_RESULT: ${{ needs.rust-ci.result }}
PYTHON_BINDINGS_RESULT: ${{ needs.python-bindings.result }}
run: |
echo "pre-commit: $PRE_COMMIT_RESULT"
echo "rust ci: $RUST_CI_RESULT"
echo "python bindings: $PYTHON_BINDINGS_RESULT"
for result in \
"$PRE_COMMIT_RESULT" \
"$RUST_CI_RESULT" \
"$PYTHON_BINDINGS_RESULT"
do
test "$result" = "success" || test "$result" = "skipped"
done