|
1 | | -name: Go |
| 1 | +name: GoFrame CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - master |
7 | | - - main |
8 | 7 | - develop |
9 | | - - staging |
10 | 8 | pull_request: |
11 | | - branches: [ master ] |
| 9 | + branches: [master, develop] |
12 | 10 | env: |
13 | 11 | GF_DEBUG: 1 |
14 | 12 |
|
15 | 13 | jobs: |
16 | | - |
17 | 14 | code-test: |
18 | 15 | runs-on: ubuntu-latest |
19 | 16 | # Service containers to run with `code-test` |
20 | 17 | services: |
21 | 18 | redis: |
22 | | - image: redis |
| 19 | + image : redis |
23 | 20 | options: >- |
24 | | - --health-cmd "redis-cli ping" |
| 21 | + --health-cmd "redis-cli ping" |
25 | 22 | --health-interval 10s |
26 | | - --health-timeout 5s |
27 | | - --health-retries 5 |
| 23 | + --health-timeout 5s |
| 24 | + --health-retries 5 |
28 | 25 | ports: |
29 | 26 | # Maps tcp port 6379 on service container to the host |
30 | 27 | - 6379:6379 |
31 | | - postgres: |
32 | | - image: postgres:9 |
33 | | - # Provide the password for postgres |
34 | | - env: |
35 | | - POSTGRES_PASSWORD: postgres |
36 | | - # Set health checks to wait until postgres has started |
37 | | - options: >- |
38 | | - --health-cmd pg_isready |
39 | | - --health-interval 10s |
40 | | - --health-timeout 5s |
41 | | - --health-retries 5 |
42 | | - ports: |
43 | | - # Maps tcp port 5432 on service container to the host |
44 | | - - 5432:5432 |
45 | 28 | mysql: |
46 | 29 | image: mysql:5.7 |
47 | 30 | env: |
| 31 | + MYSQL_DATABASE : test |
48 | 32 | MYSQL_ROOT_PASSWORD: 12345678 |
49 | | - MYSQL_DATABASE: test |
50 | 33 | ports: |
51 | 34 | # Maps tcp port 3306 on service container to the host |
52 | 35 | - 3306:3306 |
53 | 36 |
|
54 | 37 | # strategy set |
55 | 38 | strategy: |
56 | 39 | matrix: |
57 | | - go: [ '1.13', '1.14','1.15','1.16' ] |
| 40 | + go: ["1.14", "1.15", "1.16"] |
58 | 41 |
|
59 | 42 | steps: |
60 | | - |
61 | | - |
| 43 | + - name: Set Up Timezone |
| 44 | + |
62 | 45 | with: |
63 | 46 | timezoneLinux: "Asia/Shanghai" |
64 | 47 |
|
65 | | - - uses: actions/checkout@v2 |
| 48 | + - name: Checkout Repositary |
| 49 | + uses: actions/checkout@v2 |
66 | 50 |
|
67 | | - - name: Set up Go |
| 51 | + - name: Set Up Go |
68 | 52 | uses: actions/setup-go@v2 |
69 | 53 | with: |
70 | 54 | go-version: ${{ matrix.go }} |
71 | 55 |
|
72 | | - - name: Before script |
| 56 | + - name: Before Script |
73 | 57 | run: | |
74 | 58 | date |
75 | 59 | find . -name "*.go" | xargs gofmt -w |
76 | 60 | git diff --name-only --exit-code || exit 1 |
77 | 61 | sudo echo "127.0.0.1 local" | sudo tee -a /etc/hosts |
78 | 62 |
|
79 | | - # - name: Build |
80 | | - # run: go build -v ./... |
81 | | - |
82 | | - - name: 386 mode Test |
| 63 | + - name: Run i386 Arch Test |
83 | 64 | run: GOARCH=386 go test -v ./... || exit 1 |
84 | 65 |
|
85 | | - - name: amd64 mode Test |
| 66 | + - name: Run amd64 Arch Test |
86 | 67 | run: GOARCH=amd64 go test -v ./... -race -coverprofile=coverage.txt -covermode=atomic |
87 | 68 |
|
88 | | - - name: report coverage |
| 69 | + - name: Report Coverage |
89 | 70 | run: bash <(curl -s https://codecov.io/bash) |
90 | 71 |
|
0 commit comments