-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (51 loc) · 1.39 KB
/
api.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
name: Tabroom API CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CI: true
TZ: 'America/Chicago'
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
NODE_ENV: 'test'
jobs:
build:
runs-on: ubuntu-latest
services:
mariadb-test:
image: mariadb:10.11.2
ports:
- '3306:3306'
env:
MARIADB_USER: tabroom
MARIADB_PASSWORD: tabroom
MARIADB_DATABASE: tabroom
MARIADB_ROOT_PASSWORD: tabroom
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v3
- name: Shutdown Ubuntu MySQL
run: sudo service mysql stop
- name: Load local database
run: mysql -h 127.0.0.1 -P 3306 -u root -ptabroom tabroom < ./tests/tabroom.sql
- name: Get node
uses: actions/setup-node@v1
with:
node-version: 18.2.0
- name: Install packages
run: npm install
- name: Copy config file
run: cp ./config/config.js.sample ./config/config.js
- name: Lint
run: npm run lint
- name: Tests
run: npm run test-ci
- name: If tests passed change icon
if: success()
run: echo "SLACK_ICON=:white_check_mark:" >> $GITHUB_ENV
- name: Send slack notification
if: always()
uses: speechanddebate/action-slack-notify@master