-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
53 lines (48 loc) · 1.55 KB
/
.gitlab-ci.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
# gitlab ci/cd file for students repo:
# 1. grade students' tasks (and merge requests)
# 2. grade students' merge requests to tests repo
#
# should be configured to run as external ci/cd file (from public repo)
# students has developer role, so they can't change ci/cd settings, so the file is fixed
variables:
GIT_DEPTH: 1
GIT_STRATEGY: clone
REGISTRY: registry.gitlab.com/manytask/test/course-template-test-public
REF_DIR: /opt/shad
# Testing and Grading all tasks
grade:
image: $REGISTRY/testenv:latest
rules:
# never run in public repo
- if: $CI_PROJECT_NAME =~ /^public-(fall|spring)-20\d\d/
when: never
# never run on contributing branches
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /contributing/ || $CI_COMMIT_BRANCH =~ /contributing/
when: never
# otherwise run always
- when: on_success
script:
- python -m checker grade
--timestamp $CI_PIPELINE_CREATED_AT
--username $GITLAB_USER_LOGIN
--submit-score
-- $CI_PROJECT_DIR $REF_DIR
timeout: 10 minutes
# Checking contribution to the public repo
check:
image: $REGISTRY/testenv:latest
rules:
# never run in public repo
- if: $CI_PROJECT_NAME =~ /^public-(fall|spring)-20\d\d/
when: never
# run on contributing branches
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /contributing/ || $CI_COMMIT_BRANCH =~ /contributing/
when: on_success
# otherwise never run
- when: never
script:
- python -m checker check
--silent
--contributing
-- $CI_PROJECT_DIR $REF_DIR
timeout: 30 minutes