Skip to content

Commit

Permalink
Separate windows-latest from build
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Apr 11, 2024
1 parent 4cd2e3c commit 04e294d
Showing 1 changed file with 76 additions and 8 deletions.
84 changes: 76 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
arch: [x64]
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
defaults:
run:
Expand All @@ -25,7 +25,6 @@ jobs:

steps:
- name: Free disk space (Ubuntu)
if: runner.os == 'Linux'
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
Expand All @@ -37,7 +36,6 @@ jobs:
swap-storage: true

- name: Install runner dependencies
if: runner.os == 'Linux'
run: sudo apt-get install -y curl clang git libssl-dev make pkg-config

- name: Checkout repository
Expand Down Expand Up @@ -76,7 +74,6 @@ jobs:
run: python -m pip install --upgrade pip setuptools wheel pre-commit msgspec

- name: Install TA-Lib (Linux)
if: runner.os == 'Linux'
run: |
make install-talib
poetry run pip install ta-lib
Expand Down Expand Up @@ -104,26 +101,97 @@ jobs:
pre-commit run --all-files
- name: Install Redis (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install redis-server
redis-server --daemonize yes
- name: Run nautilus_core cargo tests (Linux)
if: runner.os == 'Linux'
run: |
cargo install cargo-nextest
make cargo-test
- name: Run tests (Linux)
if: runner.os == 'Linux'
run: |
make pytest
make test-examples
build-windows:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/nightly'
strategy:
fail-fast: false
matrix:
arch: [x64]
os: [windows-latest]
python-version: ["3.10", "3.11", "3.12"]
defaults:
run:
shell: bash
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
BUILD_MODE: debug
RUST_BACKTRACE: 1

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

- name: Get Rust version from rust-toolchain.toml
id: rust-version
run: |
version=$(awk -F\" '/version/ {print $2}' nautilus_core/rust-toolchain.toml)
echo "Rust toolchain version $version"
echo "RUST_VERSION=$version" >> $GITHUB_ENV
working-directory: ${{ github.workspace }}

- name: Set up Rust tool-chain (Linux, Windows) stable
uses: actions-rust-lang/[email protected]
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt, clippy

- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Get Poetry version from poetry-version
run: |
version=$(cat poetry-version)
echo "POETRY_VERSION=$version" >> $GITHUB_ENV
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}

- name: Install build dependencies
run: python -m pip install --upgrade pip setuptools wheel pre-commit msgspec

- name: Setup cached pre-commit
id: cached-pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-${{ matrix.python-version }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set poetry cache-dir
run: echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV

- name: Poetry cache
id: cached-poetry
uses: actions/cache@v4
with:
path: ${{ env.POETRY_CACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: Run pre-commit
run: |
# pre-commit run --hook-stage manual gitlint-ci
pre-commit run --all-files
# Run tests without parallel build (avoids linker errors)
- name: Run tests (Windows)
if: runner.os == 'Windows'
run: |
poetry install --with test --all-extras
poetry run pytest --ignore=tests/performance_tests --new-first --failed-first
Expand Down

0 comments on commit 04e294d

Please sign in to comment.