Repository navigation
172 lines (148 loc) · 5.46 KB
/
Copy pathtests.yml
File metadata and controls
172 lines (148 loc) · 5.46 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: IT 140 Checks
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.repository }}-${{ github.ref }}
cancel-in-progress: true
jobs:
course-repository-check:
name: Course repository check
if: ${{ github.repository == 'GC-STEM/it140-projects' }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install Ruff
run: |
python -m pip install --disable-pip-version-check "ruff==0.16.3"
- name: Check repository structure and starter artifacts
run: |
python .github/ci/check_repository.py --mode starter
- name: Compile course and starter Python files
run: |
python -m py_compile \
prototype/move_between_rooms.py \
src/text_based_game.py \
tests/test_move_between_rooms.py \
tests/test_text_based_game.py \
.github/ci/check_repository.py \
.github/ci/check_readme_commands.py \
.github/ci/check_starter.py
- name: Run Ruff on course and starter Python files
run: |
python -m ruff check \
prototype/move_between_rooms.py \
src/text_based_game.py \
tests/test_move_between_rooms.py \
tests/test_text_based_game.py \
.github/ci/check_repository.py \
.github/ci/check_readme_commands.py \
.github/ci/check_starter.py \
--output-format=github
- name: Validate course starter
run: |
python .github/ci/check_starter.py
- name: Write course repository summary
if: ${{ always() }}
shell: bash
run: |
echo "## IT 140 Projects course repository check" \
>> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "This job protects the public M5–M7 starter package," \
"documentation, configuration, and course-provided artifacts." \
>> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Student project quality is graded from the current D2L" \
"Guidelines and Rubrics, not from this workflow." \
>> "$GITHUB_STEP_SUMMARY"
student-project-check:
name: Project checkpoint check
if: >-
${{
github.repository != 'GC-STEM/it140-projects' &&
github.event_name == 'push'
}}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install Ruff
run: |
python -m pip install --disable-pip-version-check "ruff==0.16.3"
- name: Check project checkpoint
run: |
python .github/ci/check_repository.py --mode student
- name: Code style feedback
if: ${{ always() }}
shell: bash
run: |
root="$(git rev-list --max-parents=0 HEAD | head -n 1)"
files=()
for path in \
prototype/move_between_rooms.py \
src/text_based_game.py
do
if ! git diff --quiet "$root" HEAD -- "$path"; then
files+=("$path")
fi
done
if (( ${#files[@]} == 0 )); then
echo "No changed project Python file needs Ruff feedback."
exit 0
fi
set +e
python -m ruff check "${files[@]}" --output-format=github
ruff_status=$?
set -e
if (( ruff_status == 0 )); then
echo "Ruff found no suggestions in changed project Python files."
else
echo "Ruff found advisory style or quality suggestions."
echo "These suggestions do not change the workflow result."
fi
exit 0
- name: Write student summary
if: ${{ always() }}
shell: bash
run: |
echo "## IT 140 Projects checkpoint feedback" \
>> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "This is formative repository feedback for the progressive" \
"Module 5 → Module 6 → Module 7 project sequence." \
>> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "A newly created personal repository is not treated as an" \
"error merely because graded starter files are untouched." \
>> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "After graded work begins, the checkpoint check can report" \
"incomplete starter artifacts, Python syntax/structure problems," \
"or unexpected changes to course-managed files." \
>> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Ruff feedback is advisory and does not by itself make this" \
"workflow fail." >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "A green result is not a grade or a submission. D2L" \
"Brightspace remains the submission and grading system." \
>> "$GITHUB_STEP_SUMMARY"