-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.checker.yml
155 lines (131 loc) · 5.16 KB
/
.checker.yml
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
version: 1
# can be overwritten in .task.yml for individual tasks
structure:
ignore_patterns: [".git", ".github", ".idea", ".vscode", "__pycache__", ".venv", ".*_cache", "*.pyc"]
# public patterns: include in export, overwrite during testing
public_patterns: [".task.yml", ".group.yml", "README.md", ".lecture", ".gitlab-ci-students.yml", "requirements.txt", "tools", "pyproject.toml", ".gitignore", "test_public.py", "conftest.py"]
# private patterns: exclude from export, overwrite during testing
private_patterns: [".*", "test_private.py"]
# default values for all tasks, can be overwritten in .task.yml params:
default_parameters:
run_typechecking: true
run_linting: true
run_testing: true
partially_scored: false
merge_request_task: false
timeout: 60 # seconds
coverage: null # 0..1, null for no measurement
# settings for export command, uses .deadlines.yml and `params` and each task params (in .task.yml)
export:
destination: https://gitlab.manytask.org/test/public-test-repo
default_branch: main
commit_message: "chore(auto): export new tasks"
templates: search_or_create # search, create or search_or_create
# settings for Tester, uses .checker.yml and `params` and each task params (in .task.yml)
testing:
changes_detection: branch_name # branch_name, commit_message, last_commit_changes, files_changed
search_plugins: ["tools/plugins"]
# run once per repo
global_pipeline:
- name: "List temp dir"
fail: fast # fast, after_all, never
run: "run_script"
args:
origin: ${{ global.temp_dir }}
script: "ls -la ."
- name: "Fail never"
fail: never # fast, after_all, never
run: "run_script"
args:
origin: ${{ global.temp_dir }}
script: "false"
- name: "Greeting"
fail: fast # fast, after_all, never
run: "run_script"
args:
origin: ${{ global.temp_dir }}
script: "echo ${{ global.temp_dir }}"
# run once per task
tasks_pipeline:
- name: "Check forbidden regexps"
fail: fast # fast, after_all, never
run: "check_regexps"
args:
origin: "${{ global.temp_dir }}/${{ task.task_sub_path }}"
patterns: ["**/*.py"]
regexps: ["exit(0)"]
- name: "Run linter"
run_if: ${{ parameters.run_linting }}
fail: after_all # fast, after_all, never
run: "run_script"
args:
origin: ${{ global.temp_dir }}
script: "python -m ruff check --config=pyproject.toml ${{ task.task_sub_path }}"
- name: "Run typechecker"
run_if: ${{ parameters.run_typechecking }}
fail: after_all # fast, after_all, never
run: "run_script"
args:
origin: ${{ global.temp_dir }}
script: "python -m mypy --config-file=pyproject.toml ${{ task.task_sub_path }}"
- name: "Collect tests"
run_if: ${{ parameters.run_testing }}
fail: after_all # fast, after_all, never
run: "run_script"
args:
origin: ${{ global.temp_dir }}
script: "python -m pytest --tb=no -qq --collect-only ${{ task.task_sub_path }}"
timeout: ${{ parameters.timeout }}
# isolate: true
- name: "Run tests"
run_if: ${{ parameters.run_testing }}
fail: after_all # fast, after_all, never
run: "run_pytest"
register_output: "pytest_output"
args:
origin: ${{ global.temp_dir }}
target: ${{ task.task_sub_path }}
timeout: ${{ parameters.timeout }}
coverage: ${{ parameters.coverage }}
partially_scored: ${{ parameters.partially_scored }}
# isolate: true
# - name: "Run Merge Request checks"
# run_if: ${{ parameters.merge_request_task }}
# fail: after_all # fast, after_all, never
# run: "check_gitlab_merge_request"
# args:
# token: ${{ env.GITLAB_API_TOKEN }}
# task_dir: ${{ task.task_sub_path }}
# repo_url: ${{ env.REPOSITORY_URL }}
# requre_approval: ${{ parameters.merge_request_task }}
# search_for_score: ${{ parameters.merge_request_task }}
# will run once per task only if task_pipeline NOT failed
report_pipeline:
# - name: "Search score in MR"
# run_if: ${{ parameters.merge_request_task }}
# run: "search_score_in_gitlab_merge_request"
# register_output: "final_score"
# args:
# token: ${{ env.GITLAB_API_TOKEN }}
# repo_url: ${{ env.REPOSITORY_URL }}
# mr_label: ${{ task.task_name }}
# score_by: "https://gitlab.manytask.org/test"
- name: "Aggregate score"
run_if: ${{ not parameters.merge_request_task }}
run: "aggregate"
register_output: "final_score"
args:
scores: ["${{ outputs.pytest_output.percentage }}"]
weights: [1.0]
strategy: "mean" # mean, min, max, product, sum
- name: "Report Score Manytask"
run: "report_score_manytask"
args:
origin: "${{ global.temp_dir }}/${{ task.task_sub_path }}"
report_url: "https://gitlab.manytask.org/test/report"
report_token: "test"
patterns: ["**/*.py"]
username: "test"
task_name: ${{ task.task_name }}
check_deadline: ${{ parameters.merge_request_task }}
score: ${{ outputs.final_score.percentage }}