-
Notifications
You must be signed in to change notification settings - Fork 48
131 lines (110 loc) · 2.97 KB
/
tests.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
tests:
env:
CGO_ENABLED: 0
name: Test code
runs-on: ubuntu-latest
strategy:
matrix:
go:
- ^1.18
- ^1.19
- ^1
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v2
- name: Checkout to the latest tag
run: |
# Fetch all tags
git fetch --depth=1 --tags
# Get the latest tag
VERS=$(git tag -l | sort -Vr | head -n1)
# Fetch everything to the latest tag
git fetch --shallow-since=$(git log $VERS -1 --format=%at)
if: ${{ github.event_name == 'push' }} # only when built from master
- name: Build project
run: make
- name: Test
run: make test
env:
CGO_ENABLED: 1
- name: Test
run: make test
env:
CGO_ENABLED: 1
- name: Test (with GMT+5)
run: |
go clean -testcache
TZ=Etc/GMT+5 make test
env:
CGO_ENABLED: 1
# Some tests are broen in GMT-5
# --- FAIL: TestProm1UnpackFast (1.34s)
# prometheus_test.go:74:
# Error Trace: prometheus_test.go:74
# Error: Not equal:
# expected:
# Test: TestProm1UnpackFast
# FAIL
# FAIL github.com/lomik/carbon-clickhouse/receiver 2.515s
# - name: Test (with GMT-5)
# run: |
# go clean -testcache
# TZ=Etc/GMT-5 make test
# env:
# CGO_ENABLED: 1
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7' # Version range or exact version of a Ruby version to use, using semvers version range syntax.
- name: Install packaging dependencies
run: |
gem install fpm package_cloud
GO111MODULE=off go get github.com/mitchellh/gox
- name: Check packaging
run: |
make DEVEL=1 gox-build fpm-deb fpm-rpm
make sum-files
- name: Artifact
id: artifact
uses: actions/upload-artifact@v2
with:
name: packages-${{ matrix.go }}
path: |
*.deb
*.rpm
sha256sum
md5sum
- name: Push packages to the autobuilds repo
if: ${{ github.event_name == 'push' && matrix.go == '^1' }} # only when built from master with latest go
run: make DEVEL=1 packagecloud-autobuilds
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
integration_tests:
name: Integration tests
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1
- name: Integration tests
run: |
make e2e-test
./e2e-test -config tests -abort -rmi