-
Notifications
You must be signed in to change notification settings - Fork 5
42 lines (39 loc) · 1.54 KB
/
tests.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
name: Run tests
permissions:
contents: read
on: [push]
jobs:
test-sh:
name: Test files and run coverage
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: testbench
ports:
- "3306:3306"
options: --name mysql-server --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: prepare mysql server
env:
TEST_MYSQL_HOST: "127.0.0.1"
TEST_MYSQL_USER: root
TEST_MYSQL_PASS: testbench
TEST_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
run: mysql --host ${TEST_MYSQL_HOST} -u${TEST_MYSQL_USER} -p${TEST_MYSQL_PASS} --port ${TEST_MYSQL_PORT} -e "use mysql; delete from user where User != 'root' OR host != '%'; update user set authentication_string=PASSWORD('testbench'), host='%', password_last_changed=FROM_UNIXTIME(1523829600) where User='root'; update user set plugin='mysql_native_password'; delete from user where User = 'sys'; FLUSH PRIVILEGES;"
- name: run my tests
uses: sudo-bot/action-shunit2@latest
with:
cli: "./run-tests.sh"
env:
TEST_MYSQL_HOST: "mysql-server"
TEST_MYSQL_USER: root
TEST_MYSQL_PASS: testbench
TEST_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Send coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/cov.xml