-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (62 loc) · 1.53 KB
/
ci.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
name: Continuous Integration
on:
push: { branches: [ main ] }
pull_request: { }
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- run: go build
test:
runs-on: ubuntu-20.04
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ''
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- '3306:3306'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- name: Setup MySQL
run: |
while true;
do
if [ "$(mysql -h 127.0.0.1 -u root -N -s -e 'select 1' 2> /dev/null)" == "1" ];
then
break
fi
sleep 1
done
mysql -h 127.0.0.1 -u root -e 'create database cbng; create database enwiki_p'
mysql -h 127.0.0.1 -u root cbng < cluebot.sql
mysql -h 127.0.0.1 -u root enwiki_p < .github/enwiki_p.sql
- run: go test
env:
BOT_CFG: .github/config.yaml
vet:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- run: go vet
golangci:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.23'
- uses: golangci/golangci-lint-action@v6