Skip to content

Commit

Permalink
ENG-1075: Ruff CI (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
daabr authored Jul 9, 2024
1 parent d19baae commit def3504
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Continuous Integration workflow. For more information see:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
# https://docs.astral.sh/ruff/integrations/#github-actions

name: CI

on:
push:
branches: [main]
pull_request:

jobs:
lint-format-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint & format with ruff
run: |
ruff check --output-format github .
ruff format --check .
# (Enable this step once we have unit tests)
# - name: Test with pytest
# run: pytest -v
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Add "test" once we have unit tests
all: deps format lint # test

deps:
python -m pip install -r requirements.txt

format: deps
ruff format .

lint: deps
ruff check --fix --output-format full .

test: deps
pytest -v

.PHONY: all deps format lint test
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest ~= 8.2
ruff ~= 0.5

0 comments on commit def3504

Please sign in to comment.