mirror of
https://github.com/openai/harmony.git
synced 2025-08-22 16:17:08 -04:00
ci
This commit is contained in:
parent
64bca4cf32
commit
0c69fd960d
2 changed files with 81 additions and 0 deletions
67
.github/actions/run-rust-python-tests/action.yml
vendored
Normal file
67
.github/actions/run-rust-python-tests/action.yml
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
name: Run Rust and Python tests
|
||||
|
||||
description: Format, clippy, Rust tests (incl. doctests), build Python extension and run pytest
|
||||
|
||||
inputs:
|
||||
python-version:
|
||||
description: Python version to use
|
||||
required: false
|
||||
default: "3.11"
|
||||
rust-toolchain:
|
||||
description: Rust toolchain channel
|
||||
required: false
|
||||
default: stable
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: ${{ inputs.rust-toolchain }}
|
||||
components: clippy,rustfmt
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ inputs.python-version }}
|
||||
|
||||
- name: Upgrade pip
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
|
||||
- name: Install build/test deps
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install maturin pytest
|
||||
|
||||
- name: Check rustfmt
|
||||
shell: bash
|
||||
run: |
|
||||
cargo fmt --all --check
|
||||
|
||||
- name: Run clippy
|
||||
shell: bash
|
||||
run: |
|
||||
cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
||||
- name: Run Rust tests (unit/integration)
|
||||
shell: bash
|
||||
run: |
|
||||
cargo test --all-targets --all-features
|
||||
|
||||
- name: Run Rust doctests
|
||||
shell: bash
|
||||
run: |
|
||||
cargo test --doc
|
||||
|
||||
- name: Build Python extension (maturin develop)
|
||||
shell: bash
|
||||
run: |
|
||||
maturin develop --release
|
||||
|
||||
- name: Run pytest
|
||||
shell: bash
|
||||
run: |
|
||||
pytest -q
|
14
.github/workflows/CI.yml
vendored
14
.github/workflows/CI.yml
vendored
|
@ -19,6 +19,20 @@ permissions:
|
|||
contents: read
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Tests (fmt, clippy, cargo test, doctest, pytest)
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-14, windows-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run composite test suite
|
||||
uses: ./.github/actions/run-rust-python-tests
|
||||
with:
|
||||
python-version: "3.11"
|
||||
rust-toolchain: stable
|
||||
linux:
|
||||
runs-on: ${{ matrix.platform.runner }}
|
||||
strategy:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue