-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (57 loc) · 1.62 KB
/
ci.yaml
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
67
68
69
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: foreman
MYSQL_USER: foreman
MYSQL_PASSWORD: foreman
postgres:
image: postgres:9.6.2-alpine
env:
POSTGRES_DB: foreman
POSTGRES_USER: foreman
POSTGRES_PASSWORD: foreman
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.22.0
- name: Install Dependencies
run: |
make mod-download
make tools
- name: Waiting for MySQL to be ready
run: |
for i in `seq 1 10`;
do
nc -z 127.0.0.1 3306 && echo Success && exit 0
echo -n .
sleep 1
done
echo Failed waiting for MySQL && exit 1
- name: Lint
run: make lint
- name: Check dependencies for vulnerabilities
run: make check-mods || true
- name: Run tests
env:
MYSQL_CONNECTION: foreman:foreman@tcp(127.0.0.1:3306)/foreman?charset=utf8&parseTime=True
PG_CONNECTION: postgres://foreman:[email protected]:5432/foreman?sslmode=disable
run: |
make unit-test
make integration-test
- name: Upload reports to codecov
run: bash <(curl -s https://codecov.io/bash)
- name: Store test results
uses: actions/upload-artifact@v2
with:
name: test-results
path: /tmp/test-reports