Skip to content

Add validation for brackets in plain metrics and regex error parsing … #32

Add validation for brackets in plain metrics and regex error parsing …

Add validation for brackets in plain metrics and regex error parsing … #32

Workflow file for this run

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.20
- ^1.21
- ^1
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v4
- 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: Check packaging
run: |
go install github.com/goreleaser/nfpm/v2/cmd/[email protected]
make DEVEL=1 nfpm-deb nfpm-rpm
make sum-files
- name: Artifact
id: artifact
uses: actions/upload-artifact@v4
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 }}