File tree 1 file changed +45
-0
lines changed
1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ # .github/workflows/main.yml
2
+ name : Go
3
+
4
+ on :
5
+ push :
6
+ branches : [ master ]
7
+ pull_request :
8
+ branches : [ master ]
9
+
10
+ env :
11
+ DB_NAME : test_db
12
+ DB_USER : test_user
13
+ DB_PASS : test_pass
14
+
15
+ jobs :
16
+ run-code-checks :
17
+ runs-on : ubuntu-latest
18
+ steps :
19
+ - name : Set up MySQL
20
+ run : |
21
+ sudo /etc/init.d/mysql start
22
+ sudo mysql -e 'CREATE USER "${{env.DB_USER}}"@"localhost" IDENTIFIED BY "${{env.DB_PASS}}";' -uroot -proot
23
+ sudo mysql -e 'GRANT ALL PRIVILEGES ON ${{env.DB_NAME}}.* TO "${{env.DB_USER}}"@"localhost";' -uroot -proot
24
+ sudo mysql -e 'FLUSH PRIVILEGES;'
25
+ sudo mysql -e 'CREATE DATABASE ${{env.DB_NAME}};'' -u${{env.DB_USER}} -p${{env.DB_PASS}}
26
+
27
+ - name : Set up Go 1.x
28
+ uses : actions/setup-go@v2
29
+ with :
30
+ go-version : ^1.13
31
+ id : go
32
+
33
+ - name : Checkout Code Repo
34
+ uses : actions/checkout@v2
35
+
36
+ - name : Get dependencies
37
+ run : go get -v -t -d ./...
38
+
39
+ - name : Run Linting
40
+ run : |
41
+ go fmt ./...
42
+ go vet ./...
43
+
44
+ - name : Run Tests
45
+ run : go test
You can’t perform that action at this time.
0 commit comments