@@ -11,64 +11,66 @@ concurrency:
11
11
12
12
jobs :
13
13
lint :
14
- name : Check Source Style
14
+ name : Check Source Code
15
15
runs-on : ubuntu-latest
16
16
17
17
steps :
18
- - name : 📥 Check out source code
19
- uses : actions/checkout@v2
20
- with :
21
- fetch-depth : 0
18
+ - name : 📥 Check out source code
19
+ uses : actions/checkout@v4
20
+ with :
21
+ fetch-depth : 0
22
22
23
- - name : 🐍 Set up Python
24
- uses : actions/setup-python@v4
25
- with :
26
- python-version : " 3.11"
27
- cache : ' pip'
23
+ - name : 🐍 Set up Python
24
+ uses : actions/setup-python@v4
25
+ with :
26
+ python-version : " 3.11"
27
+ cache : " pip"
28
28
29
- - name : 🛠️ Install tools
30
- run : |
31
- pip install ruff
29
+ - name : 🛠️ Install development tools and dependencies
30
+ run : |
31
+ pip install -e .[dev]
32
32
33
- - name : 🪮 Check source code formatting
34
- id : format
35
- run : |
36
- if pipx run ruff format --diff $PKG_DIR; then
37
- echo passed=yes >>"$GITHUB_OUTPUT"
38
- else
39
- echo passed=no >>"$GITHUB_OUTPUT"
40
- echo "::error::source code not formatted"
41
- fi
42
- env :
43
- PKG_DIR : lenskit
33
+ - name : 🪮 Check source code formatting
34
+ id : format
35
+ run : |
36
+ if ruff format --diff $PKG_DIR; then
37
+ echo passed=yes >>"$GITHUB_OUTPUT"
38
+ else
39
+ echo passed=no >>"$GITHUB_OUTPUT"
40
+ echo "::error::source code not formatted"
41
+ fi
42
+ env :
43
+ PKG_DIR : lenskit
44
44
45
- - name : 🐜 Check source code lint rules
46
- id : lint
47
- run : |
48
- if pipx run ruff check --output-format=github $PKG_DIR; then
49
- echo passed=yes >>"$GITHUB_OUTPUT"
50
- else
51
- echo passed=no >>"$GITHUB_OUTPUT"
52
- echo "::error::source code lint check failed"
53
- fi
54
- env :
55
- PKG_DIR : lenskit
45
+ - name : 🐜 Check source code lint rules
46
+ id : lint
47
+ run : |
48
+ if ruff check --output-format=github $PKG_DIR; then
49
+ echo passed=yes >>"$GITHUB_OUTPUT"
50
+ else
51
+ echo passed=no >>"$GITHUB_OUTPUT"
52
+ echo "::error::source code lint check failed"
53
+ fi
54
+ env :
55
+ PKG_DIR : lenskit
56
56
57
- - name : 🧾 Checking results
58
- run : |
59
- if [ "$FMT_PASSED" = no ]; then
60
- echo "::error::format failed, failing build"
61
- exit 1
62
- fi
63
- if [ "$LINT_PASSED" = no ]; then
64
- if [ "$LINT_REQUIRED" = true ]; then
65
- echo "::error::lint failed, failing build"
66
- exit 2
67
- else
68
- echo "::error::lint failed but non-mandatory"
69
- fi
70
- fi
71
- env :
72
- FMT_PASSED : ${{ steps.fmt.outputs.passed }}
73
- LINT_PASSED : ${{ steps.lint.outputs.passed }}
74
- LINT_REQUIRED : False
57
+ - name : 🧾 Checking lint and format results
58
+ run : |
59
+ if [ "$FMT_PASSED" = no ]; then
60
+ echo "::error::format failed, failing build"
61
+ exit 1
62
+ fi
63
+ if [ "$LINT_PASSED" = no ]; then
64
+ if [ "$LINT_REQUIRED" = true ]; then
65
+ echo "::error::lint failed, failing build"
66
+ exit 2
67
+ else
68
+ echo "::error::lint failed but non-mandatory"
69
+ fi
70
+ fi
71
+ env :
72
+ FMT_PASSED : ${{ steps.format.outputs.passed }}
73
+ LINT_PASSED : ${{ steps.lint.outputs.passed }}
74
+ LINT_REQUIRED : False
75
+
76
+
0 commit comments