提交 fb9c32a9 创建 作者: 宋海霞's avatar 宋海霞

更新 .gitlab-ci.yaml

上级 789e15a2
...@@ -3,8 +3,6 @@ stages: ...@@ -3,8 +3,6 @@ stages:
- make - make
- code-analysis - code-analysis
- case1 - case1
- case2
- case3
variables: variables:
TEACHERCHECK_REPO: "engintime/cpp-lab/teachers-packet/c-language/Lab011.git" TEACHERCHECK_REPO: "engintime/cpp-lab/teachers-packet/c-language/Lab011.git"
...@@ -49,6 +47,18 @@ case1: ...@@ -49,6 +47,18 @@ case1:
<<: *codecode-runner <<: *codecode-runner
script: script:
- make - make
- score=60
- count=$(find . -name "input*.txt" | wc -l)
- for i in $(seq 1 1 $count)
do
./app.exe < input${i}.txt > user_output${i}.txt
diff output${i}.txt user_output${i}.txt -b -B -y -i -W 100
let score+=40/$count
if [ $i == $count ]; then
score=100
fi
execscore.sh $score
done
- ./app < input1.txt > user_output1.txt - ./app < input1.txt > user_output1.txt
- diff output1.txt user_output1.txt -b -B -y -i -W 100 - diff output1.txt user_output1.txt -b -B -y -i -W 100
- execscore.sh 60 - execscore.sh 60
...@@ -66,74 +76,12 @@ teacher-check1: ...@@ -66,74 +76,12 @@ teacher-check1:
- diff template/input1.txt input1.txt -b -B -y -i --suppress-common-lines - diff template/input1.txt input1.txt -b -B -y -i --suppress-common-lines
- diff template/output1.txt output1.txt -b -B -y -i --suppress-common-lines - diff template/output1.txt output1.txt -b -B -y -i --suppress-common-lines
- fileidentity.sh - fileidentity.sh
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${TEACHERCHECK_REPO} teacher_check
- ./app < teacher_check/input1.txt > user_output1.txt
- diff teacher_check/output1.txt user_output1.txt -b -B -y -i -W 100
- extracase.sh
only: only:
- master - master
when: manual when: manual
allow_failure: true allow_failure: true
case2:
stage: case2
<<: *codecode-runner
script:
- make
- ./app < input2.txt > user_output2.txt
- diff output2.txt user_output2.txt -b -B -y -i -W 100
- execscore.sh 80
only:
- master
teacher-check2:
stage: case2
<<: *codecode-runner
script:
- make
- ./app < input2.txt > /dev/null
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${CI_PROJECT_FORKSOURCE} template
- diff template/.gitlab-ci.yml .gitlab-ci.yml -b -B -y -i --suppress-common-lines
- diff template/input2.txt input2.txt -b -B -y -i --suppress-common-lines
- diff template/output2.txt output2.txt -b -B -y -i --suppress-common-lines
- fileidentity.sh
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${TEACHERCHECK_REPO} teacher_check
- ./app < teacher_check/input2.txt > user_output2.txt
- diff teacher_check/output2.txt user_output2.txt -b -B -y -i -W 100
- extracase.sh
only:
- master
when: manual
allow_failure: true
case3:
stage: case3
<<: *codecode-runner
script:
- make
- ./app < input3.txt > user_output3.txt
- diff output3.txt user_output3.txt -b -B -y -i -W 100
- execscore.sh 100
only:
- master
teacher-check3:
stage: case3
<<: *codecode-runner
script:
- make
- ./app < input3.txt > /dev/null
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${CI_PROJECT_FORKSOURCE} template
- diff template/.gitlab-ci.yml .gitlab-ci.yml -b -B -y -i --suppress-common-lines
- diff template/input3.txt input3.txt -b -B -y -i --suppress-common-lines
- diff template/output3.txt output3.txt -b -B -y -i --suppress-common-lines
- fileidentity.sh
- git clone ${CODECODE_PROTOCOL}gitlab-ci-token:${CI_JOB_TOKEN}@${CODECODE_DOMAIN}/${TEACHERCHECK_REPO} teacher_check
- ./app < teacher_check/input3.txt > user_output3.txt
- diff teacher_check/output3.txt user_output3.txt -b -B -y -i -W 100
- extracase.sh
only:
- master
when: manual
allow_failure: true
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论