-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add tests for service module (#384) * Add `update_clients` service (#383) * Update GitHub tests workflow (#385) * Add `force_clients` possibility (#386) * Add system services (#391) * Add timestamp converters (#392) * Add speedtest data collection (#393) * Add Python 3.12 to the CI workflow (#398) * Improve error messages (#399) * Bump version to `1.2.0` * Convert speedtest data to bps (#394)
- Loading branch information
1 parent
179e924
commit 192d876
Showing
16 changed files
with
536 additions
and
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,42 +7,81 @@ on: | |
- dev | ||
pull_request: ~ | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
env: | ||
DEFAULT_PYTHON: 3.11 | ||
- cron: "0 0 * * *" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
prepare: | ||
name: Preparation | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.11, 3.12] | ||
outputs: | ||
pip_cache_dir: ${{ steps.pip-cache.outputs.dir }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Get pip cache directory path | ||
id: pip-cache | ||
run: echo "PIP_CACHE_DIR=$(pip cache dir)" >> $GITHUB_ENV | ||
run: echo "dir=$(pip cache dir)" >> $GITHUB_ENV | ||
|
||
- name: Cache pip dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.PIP_CACHE_DIR }} | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} | ||
path: ${{ env.dir }} | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements_test.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install project dependencies | ||
run: | | ||
pip install . | ||
pip install -r requirements.txt | ||
- name: Install test dependencies | ||
run: | | ||
pip install -r requirements_test.txt | ||
unit-tests: | ||
name: Unit Tests | ||
needs: prepare | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.11, 3.12] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Get pip cache directory path | ||
id: pip-cache | ||
run: echo "dir=$(pip cache dir)" >> $GITHUB_ENV | ||
|
||
- name: Cache pip dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.dir }} | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements_test.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install project dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Install test dependencies | ||
run: | | ||
|
@@ -52,10 +91,76 @@ jobs: | |
run: | | ||
pytest --cov=asusrouter --cov-report=xml:unit-tests-cov.xml -k 'not test_devices' | ||
- name: Upload coverage to artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: unit-tests-cov | ||
path: unit-tests-cov.xml | ||
|
||
device-tests: | ||
name: Device Tests | ||
needs: prepare | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.11, 3.12] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Get pip cache directory path | ||
id: pip-cache | ||
run: echo "dir=$(pip cache dir)" >> $GITHUB_ENV | ||
|
||
- name: Cache pip dependencies | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.dir }} | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements_test.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install project dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Install test dependencies | ||
run: | | ||
pip install -r requirements_test.txt | ||
- name: Run real-data tests | ||
run: | | ||
pytest --cov=asusrouter --cov-report=xml:real-data-tests-cov.xml tests/test_devices.py --log-cli-level=INFO | ||
- name: Upload coverage to artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: real-data-tests-cov | ||
path: real-data-tests-cov.xml | ||
|
||
codecov: | ||
name: Codecov | ||
needs: [unit-tests, device-tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Download coverage from artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: unit-tests-cov | ||
path: . | ||
- uses: actions/[email protected] | ||
with: | ||
name: real-data-tests-cov | ||
path: . | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
|
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
Oops, something went wrong.