Skip to content

Commit

Permalink
Test CI coverage workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Jan 8, 2025
1 parent 615ae56 commit afb08bb
Showing 1 changed file with 45 additions and 49 deletions.
94 changes: 45 additions & 49 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,23 @@ on:

jobs:
build:
strategy:
fail-fast: false
matrix:
arch: [x64]
os: [ubuntu-22.04]
python-version: ["3.12"]
name: build - python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}

# env:
# # > --------------------------------------------------
# # > sccache
# # https://github.com/Mozilla-Actions/sccache-action
# SCCACHE_IDLE_TIMEOUT: 0
# SCCACHE_DIRECT: "true"
# SCCACHE_CACHE_MULTIARCH: 1
# SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache
# RUSTC_WRAPPER: "sccache"
# CC: "sccache clang"
# CXX: "sccache clang++"
# # Incrementally compiled crates cannot be cached by sccache
# # https://github.com/mozilla/sccache#rust
# CARGO_INCREMENTAL: 0
# # > --------------------------------------------------
runs-on: ubuntu-latest
timeout-minutes: 120
env:
# > --------------------------------------------------
# > sccache
# https://github.com/Mozilla-Actions/sccache-action
SCCACHE_IDLE_TIMEOUT: 0
SCCACHE_DIRECT: "true"
SCCACHE_CACHE_MULTIARCH: 1
SCCACHE_DIR: ${{ github.workspace }}/.cache/sccache
RUSTC_WRAPPER: "sccache"
CC: "sccache clang"
CXX: "sccache clang++"
# Incrementally compiled crates cannot be cached by sccache
# https://github.com/mozilla/sccache#rust
CARGO_INCREMENTAL: 0
# > --------------------------------------------------

services:
redis:
Expand All @@ -52,16 +45,16 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Free disk space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: false
dotnet: false
haskell: false
large-packages: true
docker-images: true
swap-storage: true
# - name: Free disk space # Continue to monitor
# uses: jlumbroso/free-disk-space@main
# with:
# tool-cache: true
# android: false
# dotnet: false
# haskell: false
# large-packages: true
# docker-images: true
# swap-storage: true

- name: Install runner dependencies
run: sudo apt-get install -y curl clang git libssl-dev make pkg-config
Expand All @@ -76,7 +69,7 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "3.12"

- name: Get Python version
run: |
Expand All @@ -96,19 +89,19 @@ jobs:
- name: Install build dependencies
run: python -m pip install --upgrade pip setuptools wheel pre-commit msgspec

# - name: Cached sccache
# id: cached-sccache
# uses: actions/[email protected]
# with:
# path: ${{ env.SCCACHE_DIR }}
# key: sccache-${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock', '**/poetry.lock') }}
# restore-keys: |
# sccache-${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-
# sccache-${{ runner.os }}-${{ github.workflow }}-
# sccache-${{ runner.os }}-
#
# - name: Run sccache
# uses: mozilla-actions/[email protected]
- name: Cached sccache
id: cached-sccache
uses: actions/[email protected]
with:
path: ${{ env.SCCACHE_DIR }}
key: sccache-${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock', '**/poetry.lock') }}
restore-keys: |
sccache-${{ runner.os }}-${{ github.workflow }}-${{ github.job }}-
sccache-${{ runner.os }}-${{ github.workflow }}-
sccache-${{ runner.os }}-
- name: Run sccache
uses: mozilla-actions/[email protected]

- name: Set poetry cache-dir
run: echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV
Expand Down Expand Up @@ -140,7 +133,10 @@ jobs:
POSTGRES_DATABASE: nautilus

- name: Run tests with coverage
run: make pytest-coverage
run: |
while sleep 60; do echo "Tests are still running..."; done &
make pytest-coverage
kill %1
- name: Upload coverage report
uses: codecov/codecov-action@v4
Expand Down

0 comments on commit afb08bb

Please sign in to comment.