-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See release notes.
- Loading branch information
Showing
1,325 changed files
with
13,336 additions
and
8,743 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
name: build | ||
|
||
# Build and test NautilusTrader | ||
|
||
on: | ||
push: | ||
branches: [master, develop] | ||
branches: [master, nightly, develop] | ||
pull_request: | ||
branches: [develop] | ||
|
||
|
@@ -14,7 +12,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
arch: [x64] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: ["3.10", "3.11", "3.12"] | ||
defaults: | ||
run: | ||
|
@@ -38,21 +36,11 @@ jobs: | |
working-directory: ${{ github.workspace }} | ||
|
||
- name: Set up Rust tool-chain (Linux, Windows) stable | ||
if: (runner.os == 'Linux') || (runner.os == 'Windows') | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
components: rustfmt, clippy | ||
|
||
# Work around as actions-rust-lang does not seem to work on macOS yet | ||
- name: Set up Rust tool-chain (macOS) stable | ||
if: runner.os == 'macOS' | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- name: Set up Python environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
|
@@ -99,24 +87,20 @@ jobs: | |
# pre-commit run --hook-stage manual gitlint-ci | ||
pre-commit run --all-files | ||
- name: Install Redis (macOS) | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew install redis | ||
redis-server --daemonize yes | ||
- 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, macOS) | ||
if: (runner.os == 'Linux') || (runner.os == 'macOS') | ||
run: make cargo-test | ||
- name: Run nautilus_core cargo tests (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
cargo install cargo-nextest | ||
make cargo-test | ||
- name: Run tests (Linux, macOS) | ||
if: (runner.os == 'Linux') || (runner.os == 'macOS') | ||
- name: Run tests (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
make pytest | ||
make test-examples | ||
|
@@ -129,3 +113,95 @@ jobs: | |
poetry run pytest --ignore=tests/performance_tests --new-first --failed-first | ||
env: | ||
PARALLEL_BUILD: false | ||
|
||
build-macos: | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/nightly' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: [x64] | ||
os: [macos-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 }} | ||
|
||
# Work around as actions-rust-lang does not seem to work on macOS yet | ||
- name: Set up Rust tool-chain (macOS) stable | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ env.RUST_VERSION }} | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- name: Set up Python environment | ||
uses: actions/setup-python@v4 | ||
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@v3 | ||
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@v3 | ||
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 | ||
- name: Install Redis (macOS) | ||
run: | | ||
brew install redis | ||
redis-server --daemonize yes | ||
- name: Run nautilus_core cargo tests (macOS) | ||
run: | | ||
cargo install cargo-nextest | ||
make cargo-test | ||
- name: Run tests (macOS) | ||
run: | | ||
make pytest | ||
make test-examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
name: docker | ||
|
||
# Build NautilusTrader docker images | ||
|
||
on: | ||
push: | ||
branches: [master, develop] | ||
branches: [master, nightly] | ||
|
||
jobs: | ||
build-docker-images: | ||
|
@@ -47,18 +45,18 @@ jobs: | |
id: branch-name | ||
uses: tj-actions/[email protected] | ||
|
||
- name: Build nautilus_trader image (develop) | ||
if: ${{ steps.branch-name.outputs.current_branch == 'develop' }} | ||
id: docker_build_trader_develop | ||
- name: Build nautilus_trader image (nightly) | ||
if: ${{ steps.branch-name.outputs.current_branch == 'nightly' }} | ||
id: docker_build_trader_nightly | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ".docker/nautilus_trader.dockerfile" | ||
push: true | ||
tags: ghcr.io/${{ github.repository_owner }}/nautilus_trader:develop | ||
tags: ghcr.io/${{ github.repository_owner }}/nautilus_trader:nightly | ||
cache-from: type=gha | ||
cache-to: type=gha | ||
- name: Digest nautilus_trader image | ||
run: echo ${{ steps.docker_build_trader_develop.outputs.digest }} | ||
run: echo ${{ steps.docker_build_trader_nightly.outputs.digest }} | ||
|
||
- name: Build nautilus_trader image (latest) | ||
if: ${{ steps.branch-name.outputs.current_branch == 'master' }} | ||
|
@@ -73,20 +71,20 @@ jobs: | |
- name: Digest nautilus_trader image | ||
run: echo ${{ steps.docker_build_trader_latest.outputs.digest }} | ||
|
||
- name: Build jupyterlab image (develop) | ||
if: ${{ steps.branch-name.outputs.current_branch == 'develop' }} | ||
id: docker_build_jupyterlab_develop | ||
- name: Build jupyterlab image (nightly) | ||
if: ${{ steps.branch-name.outputs.current_branch == 'nightly' }} | ||
id: docker_build_jupyterlab_nightly | ||
uses: docker/build-push-action@v5 | ||
with: | ||
file: ".docker/jupyterlab.dockerfile" | ||
push: true | ||
tags: ghcr.io/${{ github.repository_owner }}/jupyterlab:develop | ||
tags: ghcr.io/${{ github.repository_owner }}/jupyterlab:nightly | ||
cache-from: type=gha | ||
cache-to: type=gha | ||
build-args: | | ||
GIT_TAG=${{ steps.branch-name.outputs.current_branch }} | ||
- name: Digest jupyterlab image | ||
run: echo ${{ steps.docker_build_jupyterlab_develop.outputs.digest }} | ||
run: echo ${{ steps.docker_build_jupyterlab_nightly.outputs.digest }} | ||
|
||
- name: Build jupyterlab image (latest) | ||
if: ${{ steps.branch-name.outputs.current_branch == 'master' }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: nightly-merge | ||
|
||
on: | ||
push: | ||
branches: [nightly-merge-test] | ||
# schedule: | ||
# - cron: '0 14 * * *' # At 14:00 UTC every day | ||
|
||
jobs: | ||
nightly-merge: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags | ||
|
||
# Temporary config before nautilus-bot account | ||
- name: Configure Git | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "Chris Sellers" | ||
- name: Merge develop into nightly | ||
run: | | ||
git checkout nightly | ||
git merge --no-ff origin/develop -m "Automated merge of develop into nightly" | ||
- name: Push changes | ||
run: | | ||
git push origin nightly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.