mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
49fe403af1
Add the ability to create a simple cluster configuration for tests that do not verify the cluster-specific behavior but instead are focused on the business logic tests, such as API surface or MetricsQL. For such tests this cluster configuration will be enough in most cases. Cluster-specific tests should continue creating custom configurations. --------- Signed-off-by: Artem Fetishev <rtm@victoriametrics.com>
122 lines
2.8 KiB
YAML
122 lines
2.8 KiB
YAML
name: main
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- cluster
|
|
- master
|
|
paths:
|
|
- '**.go'
|
|
pull_request:
|
|
branches:
|
|
- cluster
|
|
- master
|
|
paths:
|
|
- '**.go'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
cancel-in-progress: true
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
jobs:
|
|
lint:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Code checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
id: go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
cache: false
|
|
go-version: stable
|
|
|
|
- name: Cache Go artifacts
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/bin
|
|
~/go/pkg/mod
|
|
key: go-artifacts-${{ runner.os }}-check-all-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
|
|
restore-keys: go-artifacts-${{ runner.os }}-check-all-
|
|
|
|
- name: Run check-all
|
|
run: |
|
|
make check-all
|
|
git diff --exit-code
|
|
|
|
test:
|
|
name: test
|
|
needs: lint
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
scenario:
|
|
- 'test-full'
|
|
- 'test-full-386'
|
|
- 'test-pure'
|
|
|
|
steps:
|
|
- name: Code checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
id: go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
cache: false
|
|
go-version: stable
|
|
|
|
- name: Cache Go artifacts
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/bin
|
|
~/go/pkg/mod
|
|
key: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
|
|
restore-keys: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-
|
|
|
|
- name: Run tests
|
|
run: make ${{ matrix.scenario}}
|
|
|
|
- name: Publish coverage
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
file: ./coverage.txt
|
|
|
|
integration-test:
|
|
name: integration-test
|
|
needs: [lint, test]
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Code checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
id: go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
cache: false
|
|
go-version: stable
|
|
|
|
- name: Cache Go artifacts
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/bin
|
|
~/go/pkg/mod
|
|
key: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-${{ steps.go.outputs.go-version }}-${{ hashFiles('go.sum', 'Makefile', 'app/**/Makefile') }}
|
|
restore-keys: go-artifacts-${{ runner.os }}-${{ matrix.scenario }}-
|
|
|
|
- name: Run integration tests
|
|
run: make integration-test
|