-
Notifications
You must be signed in to change notification settings - Fork 9
51 lines (50 loc) · 1.64 KB
/
make-check.yml
File metadata and controls
51 lines (50 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# 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: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
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