cfengine format: Refactored code, added type hints and docstrings, expanded tests, and fixed small issues #13
Workflow file for this run
This file contains hidden or 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 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: Set python version file for uv | |
| run: | | |
| echo "${{ matrix.python-version }}" > .python-version | |
| - name: Run make check | |
| run: | | |
| make check | |
| - name: Reset python version file | |
| run: | | |
| git restore .python-version | |
| - name: See if there are changes | |
| run: | | |
| git diff --exit-code | |
| git ls-files --other --directory --exclude-standard | sed q1 |