-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (104 loc) · 3.11 KB
/
mirror.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: chocolatine
on:
pull_request:
branches-ignore:
- "ga-ignore-*"
push:
branches:
- main
env:
EXECUTABLES: "zappy_ai zappy_server zappy_gui"
jobs:
check_program_compilation:
runs-on: ubuntu-latest
container: epitechcontent/epitest-docker
steps:
- uses: actions/checkout@v4
- name: install_gui_dependencies
run: |
make install-deps-ci -C gui
- name: check_presence_of_pushed_executables
run: |
if [ -z "$EXECUTABLES" ]; then
echo "No executable to check"
exit 0
fi
for executable in $EXECUTABLES; do
if [ ! -f $executable ]; then
echo "No executables are pushed! Good!"
exit 0
else
echo "Executables are pushed! BAD!!!"
exit 1
fi
done
- name: make_program
run: make
timeout-minutes: 5
- name: make_clean
run: make clean
- name: check_presence_of_executables
run: |
if [ -z "$EXECUTABLES" ]; then
echo "No executable to check"
exit 0
fi
for executable in $EXECUTABLES; do
if [ ! -x $executable ]; then
echo "Executable : $executable not found"
exit 1
fi
done
check_coding_style:
runs-on: ubuntu-latest
container:
image: ghcr.io/epitech/coding-style-checker:latest
env:
FAILLED: 0
timeout-minutes: 2
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Create coding-style-reports.log"
run: check.sh $(pwd) $(pwd)
- name: "Parsing coding-style-reports.log"
id: error_norm
run: |
while read line; do
echo "FAILLED=1" >> $GITHUB_ENV;
ENV_TITLE=$(echo "$line" | cut -d : -f 3);
ENV_FILE=$(echo "$line" | cut -d : -f 1);
ENV_LINE=$(echo "$line" | cut -d : -f 2);
ENV_CONTENT=$(echo "$line" | cut -d : -f 4);
echo "::error title="$ENV_TITLE coding style error",file=$ENV_FILE,line=$ENV_LINE,col=5,endColumn=7::$ENV_CONTENT";
done < coding-style-reports.log
cat coding-style-reports.log >> $GITHUB_OUTPUT
- name: Check if coding style failed
if: ${{ env.FAILLED == '1' }}
run: exit 1
run_tests:
needs: [check_program_compilation]
runs-on: ubuntu-latest
container: epitechcontent/epitest-docker
steps:
- uses: actions/checkout@v4
- name: install_dependencies
run: |
make install-deps-ci -C gui
make install-deps -C ai
- name: run_tests
run: make tests_run
timeout-minutes: 5
push_to_mirror:
if: ${{ github.event_name == 'push' }}
needs: [run_tests, check_coding_style]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: ${{ secrets.MIRROR_URL }}
ssh_private_key: ${{ secrets.GIT_SSH_PRIVATE_KEY }}