-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 853 Bytes
/
test.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: Go Test
on:
pull_request:
branches: [main]
paths:
- "server/**"
env:
DB_NAME: test
DB_USER: root
DB_PASSWORD: root
DB_HOST: localhost
DB_PORT: 3306
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Golang
uses: actions/setup-go@v4
with:
go-version: 1.19
cache: false
- name: Set up MySQL
run: |
echo "Set up MySQL"
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_NAME }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- name: run migration
working-directory: ./server
run: |
cp .env.sample .env
make migrate
- name: run test
working-directory: ./server
run: make test