This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
209 lines (206 loc) · 9.15 KB
/
Daily-checklist.yaml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: NodeJS
on:
schedule:
- cron: '30 23 * * *'
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
NodeJS-AMD64:
strategy:
matrix:
nv: [10, 12, 13, 14, 16, 17, 18, 19]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image Nodejs ${{ matrix.nv }}
run: docker-compose -f "docker-compose.yml" up -d --build
env:
NODEJS_VERSION: ${{ matrix.nv }}
APP_CODE_PATH_HOST: /tmp/app/
- name: Build the Docker image mariadb
run: docker run --detach --name mariadb --network=nodejs_default -p 3306:3306 --env MARIADB_DATABASE=test --env MARIADB_USER=test --env MARIADB_PASSWORD=test --env MARIADB_ROOT_PASSWORD=password ghcr.io/deck-app/mariadb:10.7
- name: Build the Docker image Mongodb
run: docker run --detach --name mongo --network=nodejs_default -p 27017:27017 mongo:latest
- name: Node and NPM version check
run: |
docker exec nodejs_nodejs_1 node -v
docker exec nodejs_nodejs_1 npm -v
- name: Download and install the "mysql" module
run: docker exec nodejs_nodejs_1 npm install mysql
- name: Download Database information preconfigure js file
run: docker exec nodejs_nodejs_1 wget -O /src/demo_db_connection.js https://raw.githubusercontent.com/nabad600/image-test-file/main/demo_db_connection.js
- name: Verify MariaDB running from host, create Database and show Database
run: |
while ! docker exec mariadb mysqladmin --user=root --password=password --host "mariadb" ping --silent &> /dev/null ; do
echo "Waiting for database connection..."
sleep 2
done
- name: Maridb conncection check
run: docker exec nodejs_nodejs_1 node demo_db_connection.js
- name: Download and install the "mongodb" module
run: docker exec nodejs_nodejs_1 npm install mongodb --save
- name: Download encoding js file (ReferenceError TextEncoder is not defined fix)
run: docker exec nodejs_nodejs_1 wget -O /src/node_modules/whatwg-url/lib/encoding.js https://raw.githubusercontent.com/nabad600/image-test-file/main/encoding.js
- name: Download Database information preconfigure js file
run: docker exec nodejs_nodejs_1 wget -O /src/mongo_db_connection.js https://raw.githubusercontent.com/nabad600/image-test-file/main/mongo_db_connection.js
# - name: Mongodb Connection Check
# run: docker exec nodejs_nodejs_1 node mongo_db_connection.js
- name: Check Node js install or not
run: |
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3000)" != "200" ]];
do
sleep 10s
done
- name: Web site checking
run: |
curl -i http://localhost:3000/
- name: Destroy container and file
run: |
docker stop mariadb
docker stop mongo
docker-compose down
docker stop $(docker ps -a -q)
echo "y" | docker system prune -a
echo "y" | docker volume prune
sudo rm -rf /tmp/app/
- name: Create ENV
env:
ENV_TEST: ${{ secrets.ENV_TEST }}
run: |
echo "$ENV_TEST" > .env.test
shell: bash
- name: Notify on SUCCESS
if: ${{ SUCCESS() }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notification_title: "{emoji} *{job}* has {status_message}"
message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}"
footer: "Linked Repo <{repo_url}|{repo}>"
mention_users: "D056LFW47NF,"
mention_users_when: "SUCCESS"
mention_groups: "C06H0SB11JL"
mention_groups_when: "SUCCESS"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_SUCCESS }}
- name: Notify on FAIL
if: ${{ failure() }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notification_title: "{emoji} *{job}* has {status_message}"
message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}"
footer: "Linked Repo <{repo_url}|{repo}>"
mention_users: "D056LFW47NF"
mention_users_when: "failure,warnings"
mention_groups: "C06G95T1YH3"
mention_groups_when: "failure,warnings"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FAIL }}
NodeJS-ARM64:
strategy:
matrix:
nv: [10, 12, 13, 14, 16, 17, 18, 19]
runs-on: ubuntu-22.04
name: NodeJS-ARM64
steps:
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2
name: Run commands
id: runcmd
with:
arch: aarch64
distro: ubuntu22.04
run: |
uname -a
echo ::set-output name=uname::$(uname -a)
- name: Get the output
run: |
echo "The uname output was ${{ steps.runcmd.outputs.uname }}"
- name: Build the Docker image Nodejs ${{ matrix.nv }}
run: docker-compose -f "docker-compose.yml" up -d --build
env:
NODEJS_VERSION: ${{ matrix.nv }}
APP_CODE_PATH_HOST: /tmp/app/
- name: Build the Docker image mariadb
run: docker run --detach --name mariadb --network=nodejs_default -p 3306:3306 --env MARIADB_DATABASE=test --env MARIADB_USER=test --env MARIADB_PASSWORD=test --env MARIADB_ROOT_PASSWORD=password ghcr.io/deck-app/mariadb:10.7
- name: Build the Docker image Mongodb
run: docker run --detach --name mongo --network=nodejs_default -p 27017:27017 mongo:latest
- name: Node and NPM version check
run: |
docker exec nodejs_nodejs_1 node -v
docker exec nodejs_nodejs_1 npm -v
- name: Download and install the "mysql" module
run: docker exec nodejs_nodejs_1 npm install mysql
- name: Download Database information preconfigure js file
run: docker exec nodejs_nodejs_1 wget -O /src/demo_db_connection.js https://raw.githubusercontent.com/nabad600/image-test-file/main/demo_db_connection.js
- name: Verify MariaDB running from host, create Database and show Database
run: |
while ! docker exec mariadb mysqladmin --user=root --password=password --host "mariadb" ping --silent &> /dev/null ; do
echo "Waiting for database connection..."
sleep 2
done
- name: Maridb conncection check
run: docker exec nodejs_nodejs_1 node demo_db_connection.js
- name: Download and install the "mongodb" module
run: docker exec nodejs_nodejs_1 npm install mongodb --save
- name: Download encoding js file (ReferenceError TextEncoder is not defined fix)
run: docker exec nodejs_nodejs_1 wget -O /src/node_modules/whatwg-url/lib/encoding.js https://raw.githubusercontent.com/nabad600/image-test-file/main/encoding.js
- name: Download Database information preconfigure js file
run: docker exec nodejs_nodejs_1 wget -O /src/mongo_db_connection.js https://raw.githubusercontent.com/nabad600/image-test-file/main/mongo_db_connection.js
# - name: Mongodb Connection Check
# run: docker exec nodejs_nodejs_1 node mongo_db_connection.js
- name: Check Node js install or not
run: |
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3000)" != "200" ]];
do
sleep 10s
done
- name: Web site checking
run: |
curl -i http://localhost:3000/
- name: Destroy container and file
run: |
docker stop mariadb
docker stop mongo
docker-compose down
docker stop $(docker ps -a -q)
echo "y" | docker system prune -a
echo "y" | docker volume prune
sudo rm -rf /tmp/app/
- name: Create ENV
env:
ENV_TEST: ${{ secrets.ENV_TEST }}
run: |
echo "$ENV_TEST" > .env.test
shell: bash
- name: Notify on SUCCESS
if: ${{ SUCCESS() }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notification_title: "{emoji} *{job}* has {status_message}"
message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}"
footer: "Linked Repo <{repo_url}|{repo}>"
mention_users: "D056LFW47NF,"
mention_users_when: "SUCCESS"
mention_groups: "C06H0SB11JL"
mention_groups_when: "SUCCESS"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_SUCCESS }}
- name: Notify on FAIL
if: ${{ failure() }}
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
notification_title: "{emoji} *{job}* has {status_message}"
message_format: "*{workflow}* {status_message} in <{branch_url}|{branch}> Architecture <{run_url}|{job}> Approved by ${{ github.event.head_commit.author.name }}"
footer: "Linked Repo <{repo_url}|{repo}>"
mention_users: "D056LFW47NF"
mention_users_when: "failure,warnings"
mention_groups: "C06G95T1YH3"
mention_groups_when: "failure,warnings"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_FAIL }}