Skip to content

Commit

Permalink
Initial gitlab workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaerki committed Jun 30, 2024
1 parent 0322ec2 commit eae2c74
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Test

on:
push:
branches:
- master
workflow_dispatch:
# branches:
# - master
pull_request:
types:
- opened
Expand All @@ -12,6 +13,7 @@ on:
# cron every week on monday
- cron: "0 0 * * 1"


jobs:
lint:
runs-on: ubuntu-latest
Expand All @@ -24,7 +26,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
Expand All @@ -35,9 +37,7 @@ jobs:
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-pydantic-v2-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v08
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-tests.txt
- name: Install Pydantic v2
run: pip install "pydantic>=2.0.2,<3.0.0"
run: pip install -r requirements.txt -r requirements-dev.txt
- name: Lint
run: bash scripts/lint.sh

Expand All @@ -49,8 +49,6 @@ jobs:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
pydantic-version: ["pydantic-v1", "pydantic-v2"]
fail-fast: false
steps:
Expand Down
8 changes: 8 additions & 0 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set -euox pipefail


ruff check --config pyproject.toml --fix || true

python -m mypy --config-file pyproject.toml octoprobe || true

python -m pylint octoprobe || true

0 comments on commit eae2c74

Please sign in to comment.