Skip to content

Commit 2e2c582

Browse files
authored
Add files via upload
1 parent 0f1980f commit 2e2c582

2 files changed

Lines changed: 111 additions & 0 deletions

File tree

.github/workflows/gate

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/bin/bash
2+
3+
function sha ()
4+
{
5+
sha512sum | cut -d " " -f 1
6+
}
7+
8+
for f in .github/workflows/* ; do
9+
expected_sha=$(wget -qO- "https://raw.githubusercontent.com/MATF-Software-Verification/VS-project-ci/main/$f" | sha)
10+
current_sha=$(cat $f | sha)
11+
if [ "$expected_sha" != "$current_sha" ]; then
12+
echo "FATAL: Your CI files are not in sync with the official repository - make sure the .github/ directory matches the upstream"
13+
exit 2
14+
fi
15+
done
16+
if [ -f gate ]; then
17+
echo "FATAL: The 'gate' script should not be added to the repository - CI checks use the upstream version"
18+
exit 2
19+
fi
20+
echo "PASS: GitHub workflows are up to date"
21+
22+
ret=0
23+
24+
function flc ()
25+
{
26+
cat "$@" 2>/dev/null | wc -l
27+
}
28+
29+
# Submodule check
30+
submodule_count=$(git submodule | wc -l)
31+
if [ $submodule_count -eq 0 ]; then
32+
echo "FAIL: The repository does not appear to contain a submodule pointing to the original project. See: https://git-scm.com/book/en/v2/Git-Tools-Submodules"
33+
ret=1
34+
else
35+
echo "PASS: Submodule check passed"
36+
fi
37+
38+
# Binary files check
39+
if find . -exec file {} \; | grep -i elf ; then
40+
echo "FAIL: ELF files located in the repository. You should not upload executable files, use .gitignore to ignore such files."
41+
ret=1
42+
else
43+
echo "PASS: ELF type check passed"
44+
fi
45+
46+
# LICENSE check
47+
if [ ! -f LICENSE ]; then
48+
echo "WARN: LICENSE missing. Please add a license."
49+
else
50+
echo "PASS: LICENSE check"
51+
fi
52+
53+
# README check
54+
if [ -f "README.md" ]; then
55+
readme_lc=$(flc README.md)
56+
if [ $readme_lc -lt 10 ]; then
57+
echo "FAIL: README is not detailed enough. Please add a more extensive README."
58+
ret=1
59+
else
60+
echo "PASS: README check"
61+
fi
62+
else
63+
echo "FAIL: README missing"
64+
ret=1
65+
fi
66+
67+
# ProjectAnalysisReport check
68+
par_lc=$(flc ProjectAnalysisReport.*)
69+
if [ $par_lc != 0 ]; then
70+
if [ $par_lc -lt 50 ]; then
71+
echo "FAIL: ProjectAnalysisReport is not detailed enough. Please add a more extensive ProjectAnalysisReport."
72+
ret=1
73+
else
74+
echo "PASS: ProjectAnalysisReport check"
75+
fi
76+
else
77+
echo "FAIL: ProjectAnalysisReport missing"
78+
ret=1
79+
fi
80+
81+
82+
# Final note
83+
if [ $ret -ne 0 ]; then
84+
echo
85+
echo "=== GATE FAILED ==="
86+
echo "Please re-read instructions on the course webpage: https://www.verifikacijasoftvera.matf.bg.ac.rs/#1_tab"
87+
else
88+
echo "=== GATE PASSED ==="
89+
fi
90+
91+
exit $ret

.github/workflows/tickets.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: tickets
2+
on: [push, issues]
3+
4+
jobs:
5+
tickets:
6+
name: Tickets
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Tickets
10+
id: tickets
11+
uses: lee-dohm/select-matching-issues@v1
12+
with:
13+
format: raw
14+
query: 'is:open'
15+
token: ${{ github.token }}
16+
- name: Report issues
17+
run: |
18+
echo "=== Open issues ==="
19+
grep 'http' ${{ steps.tickets.outputs.path }} && exit 1 || exit 0
20+

0 commit comments

Comments
 (0)