Skip to content

Commit b23a042

Browse files
committed
add ci to task4
1 parent 762f5d8 commit b23a042

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/run_task4_tests.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
REPEAT_COUNT=3
4+
5+
for i in $(seq 1 $REPEAT_COUNT)
6+
do
7+
echo "Run #$i"
8+
./gradlew test
9+
if [ $? -ne 0 ]; then
10+
echo "Test run #$i failed."
11+
exit 1
12+
fi
13+
done

.github/workflows/task4-ci.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI for Task 4
2+
3+
on:
4+
push:
5+
paths:
6+
- 'task4/**'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: 'Set up JDK'
16+
uses: 'actions/setup-java@v4'
17+
with:
18+
java-version: '20'
19+
distribution: 'zulu'
20+
21+
- name: Grant execute permission for gradlew
22+
run: chmod +x ./task4/gradlew
23+
24+
- name: Grant execute permission for test script
25+
run: chmod +x ./task4/run_task4_tests.sh
26+
27+
- name: Build & test
28+
working-directory: ./task4
29+
run: ./run_task4_tests.sh

0 commit comments

Comments
 (0)