-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (77 loc) · 2.16 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: ci
on:
push:
pull_request:
jobs:
builds:
timeout-minutes: 20
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ 1.23.2 ]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Build
run: make build
tests:
strategy:
matrix:
name: [unit]
go-version: [ 1.23.2 ]
runs-on: ubuntu-latest
name: test (${{ matrix.name }})
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Run ${{ matrix.name }} tests
run: make test
integration:
needs: [builds, tests]
timeout-minutes: 20
runs-on: ubuntu-latest
strategy:
matrix:
name: [integration]
go-version: [ 1.23.2 ]
node-version: [ 20.6.0 ]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5
with:
go-version: ${{ matrix.go-version }}
- name: Set up Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- name: Install Newman
run: |
npm install --location=global newman
- name: Build
run: make build
- name: Run
run: go run main.go -env-file .env &
- name: Wait for REST API
run: sleep 6s
shell: bash
- name: Run Postman/Newman end-to-end tests
run: make e2e