Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .github/workflows/format.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/lint.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/make-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow installs the necessary dependencies, runs make check, and
# checks if there are any edits. It should be very similar to what developers
# are expected to do locally. We want to ensure that all tests pass (make
# check succeeds) and that there is no additional formatting / untracked
# files generated.
#
# Note that make check is a bit special in this repo, it has some things you
# might not expect:
# 1. It doesn't only run tests, it also runs formatters and linters
# 2. It installs the CFEngine CLI, so that shell tests will work

name: Run make check
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install uv
sudo apt-get install npm
npm install --global prettier
- name: Run make check
run: |
make check
- name: See if there are changes
run: |
git diff --exit-code
git ls-files --other --directory --exclude-standard | sed q1
53 changes: 0 additions & 53 deletions .github/workflows/test.yml

This file was deleted.

12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
.PHONY: default format lint install check
.PHONY: default format lint install check venv

default: check

format:
venv:
uv venv --clear
uv sync

format: venv
uv tool run black .
prettier . --write

lint:
lint: venv
uv tool run black --check .
uv tool run flake8 src/ --ignore=E203,W503,E722,E731 --max-complexity=100 --max-line-length=160
uv tool run pyflakes src/
Expand All @@ -15,7 +19,7 @@ lint:
install:
pipx install --force --editable .

check: format lint install
check: venv format lint install
uv run pytest
bash tests/run-lint-tests.sh
bash tests/run-format-tests.sh
Expand Down
Loading