forked from go-graphite/graphite-clickhouse
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (103 loc) · 3.04 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
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: Validate default configs
run: |
./graphite-clickhouse -config-print-default > /tmp/graphite-clickhouse.conf
./graphite-clickhouse -config /tmp/graphite-clickhouse.conf -check-config
- name: Check documentation consistency
run: |
make config
git diff --exit-code
- 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
- name: Test (with GMT+5)
run: |
go clean -testcache
TZ=Etc/GMT+5 make test
env:
CGO_ENABLED: 1
- name: Integration tests
run: |
make e2e-test
./e2e-test -config tests -abort -rmi
# TODO (msaf1980): find a way to set TZ in carbon-clickhouse docker (or run locally)
# run with clickhouse.date-format = "both"
# - name: Integration tests (with Etc/GMT-5)
# run: |
# make e2e-test
# sudo timedatectl set-timezone Etc/GMT-5
# ./e2e-test -config issues/daytime
# - name: Integration tests (with Etc/GMT+5)
# run: |
# make e2e-test
# sudo timedatectl set-timezone Etc/GMT+5
# ./e2e-test -config issues/daytime
- 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 }}