-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
927 additions
and
56 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
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 |
---|---|---|
|
@@ -8,56 +8,72 @@ on: | |
pull_request: | ||
|
||
env: | ||
DEFAULT_PYTHON: "3.12" | ||
UV_CACHE_DIR: /tmp/.uv-cache | ||
|
||
jobs: | ||
code-quality: | ||
runs-on: "ubuntu-latest" | ||
name: Check code quality | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | ||
id: python | ||
uses: actions/[email protected] | ||
- uses: actions/checkout@v4 | ||
- name: Set up uv | ||
# Install latest uv version using the installer | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: ".python-version" | ||
- name: Restore uv cache | ||
uses: actions/cache@v4 | ||
with: | ||
python-version: ${{ env.DEFAULT_PYTHON }} | ||
cache: "pip" | ||
cache-dependency-path: "requirements*" | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r requirements-test.txt | ||
path: /tmp/.uv-cache | ||
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | ||
restore-keys: | | ||
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | ||
uv-${{ runner.os }} | ||
- name: Install the project | ||
run: uv sync --locked --dev | ||
# Following steps cannot run by pre-commit.ci as repo = local | ||
- name: Run mypy | ||
run: mypy deebot_client/ | ||
run: uv run mypy deebot_client/ | ||
- name: Pylint review | ||
run: pylint deebot_client/ | ||
run: uv run pylint deebot_client/ | ||
- name: Verify no getLogger usages | ||
run: scripts/check_getLogger.sh | ||
- name: Minimize uv cache | ||
run: uv cache prune --ci | ||
|
||
tests: | ||
runs-on: "ubuntu-latest" | ||
name: Run tests | ||
strategy: | ||
matrix: | ||
python-version: ["3.12"] | ||
python-version: | ||
- "3.12" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- name: Set up uv | ||
# Install latest uv version using the installer | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- name: Set up Python ${{ matrix.python-version }} | ||
id: python | ||
uses: actions/[email protected] | ||
run: uv python install ${{ matrix.python-version }} | ||
- name: Restore uv cache | ||
uses: actions/cache@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
cache-dependency-path: "requirements*" | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
pip install -r requirements-test.txt | ||
path: /tmp/.uv-cache | ||
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }} | ||
restore-keys: | | ||
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }} | ||
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | ||
uv-${{ runner.os }} | ||
- name: Install the project | ||
run: uv sync --locked --dev | ||
- name: Run pytest | ||
run: pytest --cov=./ --cov-report=xml | ||
run: uv run pytest tests --cov=./ --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true | ||
- name: Minimize uv cache | ||
run: uv cache prune --ci |
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 |
---|---|---|
|
@@ -22,15 +22,26 @@ jobs: | |
- name: 📥 Checkout the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/[email protected] | ||
- name: Set up uv | ||
# Install latest uv version using the installer | ||
run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
|
||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
python-version-file: ".python-version" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -q build | ||
- name: Restore uv cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: /tmp/.uv-cache | ||
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | ||
restore-keys: | | ||
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | ||
uv-${{ runner.os }} | ||
- name: Install the project | ||
run: uv sync --locked | ||
|
||
- name: 📦 Build package | ||
run: python -m build | ||
|
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 |
---|---|---|
|
@@ -36,6 +36,7 @@ repos: | |
exclude_types: | ||
- csv | ||
- json | ||
exclude: ^uv.lock$ | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
|
@@ -54,6 +55,7 @@ repos: | |
- [email protected] | ||
exclude_types: | ||
- python | ||
exclude: ^uv.lock$ | ||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.35.1 | ||
hooks: | ||
|
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 @@ | ||
3.12 |
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.