Skip to content

Commit

Permalink
cache in CI (#458)
Browse files Browse the repository at this point in the history
* cache in CI

* using matrix for cache

* no comment required

* fix installing deps
  • Loading branch information
sonic182 committed Feb 20, 2024
1 parent 3ae8da8 commit aaea94b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,41 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20

- uses: actions/cache@v3
if: startsWith(runner.os, 'Linux')
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{matrix.python-version}}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{matrix.python-version}}-pip-
- uses: actions/cache@v3
if: startsWith(runner.os, 'macOS')
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-${{matrix.python-version}}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{matrix.python-version}}-pip-
- uses: actions/cache@v3
if: startsWith(runner.os, 'Windows')
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-${{matrix.python-version}}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{matrix.python-version}}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -55,6 +82,7 @@ jobs:
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
run: |
./tests.sh --cov-append
Expand Down
4 changes: 1 addition & 3 deletions sourcedocs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ Configure aiosonic logger at debug level to see some logging
Fastapi Usage
=============

You need to use the fastapi `dependency system <https://fastapi.tiangolo.com/tutorial/dependencies/>`_ in order to have a common HTTPClient instance

.. code-block:: python
Expand Down Expand Up @@ -236,4 +234,4 @@ You need to use the fastapi `dependency system <https://fastapi.tiangolo.com/tut
assert client, "no client"
url = "https://postman-echo.com/post"
res = await client.post(url, params={"foo": "bar"})
return (await res.json())["args"]
return (await res.json())["args"]

0 comments on commit aaea94b

Please sign in to comment.