Skip to content

Commit 530ae31

Browse files
Michael Vasseurvmcj
authored andcommitted
Clean some unneeded code for GHA
GitLab couldn't push statuses directly but GHA will.
1 parent f238a99 commit 530ae31

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

.github/jobs/unit-tests.sh

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -41,34 +41,9 @@ CNT=0
4141
THRESHOLD=32
4242
if [ $CODECOVERAGE -eq 1 ]; then
4343
CNT=$(sed -n '/Generating code coverage report/,$p' "$ARTIFACTS"/phpunit.out | grep -v DoctrineTestBundle | grep -cv ^$)
44-
FILE=deprecation.txt
45-
sed -n '/Generating code coverage report/,$p' "$ARTIFACTS"/phpunit.out > ${DIR}/$FILE
46-
if [ $CNT -le $THRESHOLD ]; then
47-
STATE=success
48-
else
49-
STATE=failure
50-
fi
51-
ORIGINAL="gitlab.com/DOMjudge"
52-
REPLACETO="domjudge.gitlab.io/-"
53-
# Copied from CCS
54-
curl https://api.github.com/repos/domjudge/domjudge/statuses/$CI_COMMIT_SHA \
55-
-X POST \
56-
-H "Authorization: token $GH_BOT_TOKEN_OBSCURED" \
57-
-H "Accept: application/vnd.github.v3+json" \
58-
-d "{\"state\": \"$STATE\", \"target_url\": \"${CI_JOB_URL/$ORIGINAL/$REPLACETO}/artifacts/$FILE\", \"description\":\"Symfony deprecations ($version)\", \"context\": \"Symfony deprecation ($version)\"}"
59-
fi
60-
if [ $UNITSUCCESS -eq 0 ]; then
61-
STATE=success
62-
else
63-
STATE=failure
6444
fi
6545
cp webapp/var/log/test.log "$ARTIFACTS"/test.log
6646

67-
curl https://api.github.com/repos/domjudge/domjudge/statuses/$CI_COMMIT_SHA \
68-
-X POST \
69-
-H "Authorization: token $GH_BOT_TOKEN_OBSCURED" \
70-
-H "Accept: application/vnd.github.v3+json" \
71-
-d "{\"state\": \"$STATE\", \"target_url\": \"${CI_PIPELINE_URL}/test_report\", \"description\":\"Unit tests\", \"context\": \"unit_tests ($version)\"}"
7247
if [ $UNITSUCCESS -ne 0 ] || [ $CNT -gt $THRESHOLD ]; then
7348
exit 1
7449
fi

0 commit comments

Comments
 (0)