-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c06520b
commit 5316914
Showing
5 changed files
with
103 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: coverage | ||
|
||
# Run code coverage analysis for NautilusTrader | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: [ x86 ] | ||
os: [ ubuntu-latest ] | ||
python-version: [ "3.10" ] | ||
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Rust setup | ||
- name: Set up Rust environment | ||
uses: hecrj/setup-rust-action@v1 | ||
with: | ||
rust-version: stable | ||
components: clippy | ||
|
||
# Python setup | ||
- name: Set up Python environment | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
# Install build dependencies | ||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel poetry pre-commit nox | ||
# Setup cached pre-commit | ||
- name: Setup cached pre-commit | ||
id: cache-pre-commit | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-pre-commit-${{ hashFiles('.github/workflows/*.yml', '.pre-commit-config.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version }}-pre-commit- | ||
# Run pre-commit | ||
- name: Run pre-commit | ||
run: pre-commit run --all-files | ||
|
||
# Setup Poetry caching | ||
- name: Get Poetry cache dir | ||
id: cache-poetry | ||
run: echo "::set-output name=dir::$(poetry config cache-dir)" | ||
|
||
- name: Poetry/Nox cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.cache-poetry.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('.github/workflows/*.yml', '**/poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version }}-poetry- | ||
# Install and run database dependencies | ||
- name: Install Redis (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get install redis-server | ||
redis-server --daemonize yes | ||
# Run tests (Linux) | ||
- name: Run tests (Linux) | ||
if: runner.os == 'Linux' | ||
run: nox -rs coverage | ||
|
||
# Upload coverage report to codecov (Linux) | ||
- name: Upload coverage report (Linux) | ||
if: runner.os == 'Linux' | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: ./coverage.xml | ||
verbose: true |
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
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