Skip to content

Add sync_native instruction #806

Add sync_native instruction

Add sync_native instruction #806

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@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
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@v2
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 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@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
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@v2
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@v2
with:
name: coverage${{ steps.uuid.outputs.uuid }}
path: .coverage
coverage:
needs: tests
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
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@v2
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@v2
- name: Run coverage
run: |
poetry run coverage combine coverage*/.coverage*
poetry run coverage xml
- name: Upload coverage to Codecov
# You may pin to the exact commit or the version.
# uses: codecov/codecov-action@6004246f47ab62d32be025ce173b241cd84ac58e
uses: codecov/[email protected]
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://github.community/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 "🎉"