Skip to content

Commit

Permalink
ci: simplify ci setup
Browse files Browse the repository at this point in the history
  • Loading branch information
eginhard committed Oct 15, 2024
1 parent 2f13956 commit 207006e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,17 @@ jobs:
python-version: [3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
cache-dependency-path: 'requirements*'
- name: check OS
run: cat /etc/os-release
version: "0.4.21"
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y git make gcc
- name: Install/upgrade dev dependencies
run: python3 -m pip install -r requirements.dev.txt
sudo apt-get install -y make
- name: Lint check
run: |
make lint
run: uv run --only-dev pre-commit run --all-files
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: "https://github.com/pre-commit/pre-commit-hooks"
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.10
rev: v0.6.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ style: ## update code style.

lint: ## run linter.
ruff check ${target_dirs}
ruff format --check ${target_dirs}

dev-deps: ## install development deps
pip install -r requirements.dev.txt
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dev = [
"coverage>=7",
"pre-commit>=3",
"pytest>=8",
"ruff==0.4.10",
"ruff==0.6.9",
"tomli>=2; python_version < '3.11'",
]
# Dependencies for running the tests
Expand Down

0 comments on commit 207006e

Please sign in to comment.