Skip to content

Use RPC health check instead of /health for is_connected (#460) #927

Use RPC health check instead of /health for is_connected (#460)

Use RPC health check instead of /health for is_connected (#460) #927

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [master]
pull_request:
branches: [master]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.6.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
- name: Run linters
run: |
make lint
tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_path: [
"tests/integration/test_async_http_client.py",
"tests/integration/test_async_token_client.py",
"tests/integration/test_http_client.py",
"tests/integration/test_token_client.py",
"tests/integration/test_websockets.py",
"tests/integration/test_recent_performance_samples.py",
"tests/integration/test_memo.py",
"tests/unit",
"src", # doctests
]
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
- name: Run tests
run: |
poetry run pytest ${{ matrix.test_path }} --cov
- name: Get uuid
id: uuid
run: |
echo "uuid=$(uuidgen)" >> $GITHUB_OUTPUT
- name: Upload partial coverage
uses: actions/upload-artifact@v4
with:
name: coverage${{ steps.uuid.outputs.uuid }}
path: .coverage
include-hidden-files: true
if-no-files-found: error
coverage:
needs: tests
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
- name: Download all coverage artifacts
# Downloads coverage1, coverage2, etc.
uses: actions/download-artifact@v4
- name: Run coverage
run: |
poetry run coverage combine coverage*/.coverage*
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
# Path to coverage file to upload
file: ./coverage.xml
env_vars: OS,PYTHON
# Specify whether or not CI build should fail if Codecov runs into an error during upload
fail_ci_if_error: true
test:
# https://gh.neting.ccmunity/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
runs-on: ubuntu-latest
needs: tests
steps:
- name: note that all tests succeeded
run: echo "🎉"