-
Notifications
You must be signed in to change notification settings - Fork 207
58 lines (55 loc) · 2.22 KB
/
check.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
name: Regression
on: # [push]
pull_request:
# pull_request_target:
types: [synchronize, opened, reopened, edited]
jobs:
job1:
runs-on: ubuntu-latest
# Map a step output to a job output
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/checkout@v2
with:
ref: refs/pull/${{ github.event.pull_request.number }}/head
- id: step1
run: |
login=${{ github.event.pull_request.user.login }}
echo "$login"
if [ "${{ github.base_ref }}" != "${{ github.head_ref }}" ]; then
echo "FIASCO: base and head branches differs"
exit 1
fi
wget -c --retry-connrefused --tries=0 -q --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet -c --retry-connrefused --tries=0 --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1grnb60AaZBCwhBqETeKOGh3tW7ggEWDJ' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1grnb60AaZBCwhBqETeKOGh3tW7ggEWDJ" -O cw-20201.tar.gz && rm -rf /tmp/cookies.txt
rm -rf /tmp/cookies.txt
docker load < cw-20201.tar.gz
docker run -d -it --name cw-2021 -v $(pwd):/usr/share/compiler-workout berezun/cw-2021
docker exec -t cw-2021 sh test.sh
echo "All checks have successfully passed"
echo "$login" > gitid.txt
echo ${{ github.base_ref }} > base.txt
branch=${{ github.base_ref }}
if [[ ${branch:1:1} -eq 0 ]]
then
echo ${branch:2:1} > assignment_number.txt
else
echo ${branch:1:2} > assignment_number.txt
fi
- name: Check Deadline
run: |
deadline=2023-10-12T23:59
if [[ $(date +'%Y-%m-%d') > $deadline ]];
then
echo "FIASCO: The deadline has expired"
exit 1
fi
- uses: actions/upload-artifact@v2
with:
name: share_info
path: |
gitid.txt
base.txt
assignment_number.txt