forked from NickWaterton/Roomba980-Python
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Run linters and formatters on latest python * Consolidate linters in single run * Update cache action to v4 * Run mosquitto for proper integration tests * Drop unstable amqtt broker
- Loading branch information
Showing
9 changed files
with
54 additions
and
352 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
allow_anonymous false | ||
listener 8883 | ||
password_file /mosquitto/config/mosquitto.passwd | ||
certfile /mosquitto-certs/test.crt | ||
keyfile /mosquitto-certs/test.key |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
test:$7$101$QwCQMINr0PmhId3d$K8g2qV5gw0Q3Dk9gXNB6TOsjGKD2tfptmdG5Ib5wEfuE4emzZjBP9L7z7y9jZFKVZQFVHMzYajnqTZk18KkGdw== |
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
black: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
|
@@ -22,88 +22,34 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
python-version: "3.12" | ||
|
||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
|
||
- name: Create venv cache | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{env.venv-path}} | ||
key: ${{ runner.os }}-venv-${{ hashFiles('poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-venv- | ||
- name: Install dependencies | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install | ||
- name: Black | ||
run: | | ||
poetry run black --config pyproject.toml --check --diff --verbose . | ||
isort: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Create venv cache | ||
id: cache-venv | ||
uses: actions/cache@v4.0.0 | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{env.venv-path}} | ||
key: ${{ runner.os }}-venv-${{ hashFiles('poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-venv- | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install | ||
- name: isort | ||
run: | | ||
poetry run isort --check --diff --verbose . | ||
flake8: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
|
||
- name: Create venv cache | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{env.venv-path}} | ||
key: ${{ runner.os }}-venv-${{ hashFiles('poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-venv- | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Install dependencies | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
|
||
- name: flake8 | ||
- name: Run linters | ||
run: | | ||
poetry run flake8 --config .flake8 --verbose --count . | ||
source .venv/bin/activate | ||
black --config pyproject.toml --check --diff --verbose . | ||
isort --check --diff --verbose . | ||
flake8 --config .flake8 --verbose --count . | ||
pytest: | ||
runs-on: ubuntu-latest | ||
|
@@ -115,27 +61,43 @@ jobs: | |
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/[email protected] | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Create venv cache | ||
id: cache-venv | ||
uses: actions/cache@v4.0.0 | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{env.venv-path}} | ||
key: ${{ runner.os }}-${{ matrix.python-version }}-venv-${{ hashFiles('poetry.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.python-version }}-venv- | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
poetry install | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Install library | ||
run: poetry install --no-interaction | ||
|
||
- name: Start Mosquitto | ||
uses: namoshek/mosquitto-github-action@v1 | ||
with: | ||
version: '2.0.18' | ||
ports: '8883:8883' | ||
certificates: ${{ github.workspace }}/.ci/tls-certificates | ||
config: ${{ github.workspace }}/.ci/mosquitto.conf | ||
password-file: ${{ github.workspace}}/.ci/mosquitto.passwd | ||
container-name: 'mqtt' | ||
|
||
- name: Run Pytest | ||
run: | | ||
poetry run pytest --verbose | ||
source .venv/bin/activate | ||
pytest --verbose |
Oops, something went wrong.