release pool memory on spawn #2154
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
flags: [ '', '-race' ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
cache: true | |
- name: Build | |
run: go build ./... | |
- name: Test | |
env: | |
GOFLAGS: ${{ matrix.flags }} | |
LOG_LEVEL: error | |
run: go test -coverprofile=profile.out -covermode=atomic -v -coverpkg=./... ./... | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: | | |
profile.out | |
profile_race.out | |
if-no-files-found: error | |
retention-days: 1 | |
- name: Run benchmarks | |
if: ${{ !contains(matrix.flags, '-race') }} | |
env: | |
LOG_LEVEL: error | |
run: go test --timeout=15m --benchtime=3x --benchmem --bench="BenchmarkLightJsonReadPar" --run=$^ ./plugin/input/file/... | |
e2e_test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
flags: [ '', '-race' ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
cache: true | |
- name: Run docker containers | |
run: make test-e2e-docker-up | |
- name: E2E | |
env: | |
GOFLAGS: ${{ matrix.flags }} | |
LOG_LEVEL: error | |
run: go test ./e2e -coverprofile=profile_e2e.out -covermode=atomic -tags=e2e_new -timeout=3m -coverpkg=./... | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: | | |
profile_e2e.out | |
profile_e2e_race.out | |
if-no-files-found: error | |
retention-days: 1 | |
upload: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
- e2e_test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: coverage | |
- name: Send coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
files: profile.out, profile_race.out, profile_e2e.out, profile_e2e_race.out, | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
cache: true | |
- name: Lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
only-new-issues: false | |
args: --timeout 5m | |
# Package/build cache already provided above. | |
# | |
# Disable module cache. | |
skip-pkg-cache: true | |
# Disable build cache. | |
skip-build-cache: true | |
check-generate: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
cache: true | |
- name: Generate doc | |
run: make gen-doc | |
- name: Generate mocks | |
run: make mock | |
- name: Go generate | |
run: go generate ./... | |
- name: Check git diff | |
run: git diff --exit-code | |
check-mod: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
cache: true | |
- name: Download dependencies | |
run: go mod download && go mod tidy | |
- name: Verify modules | |
run: go mod verify | |
- name: Check git diff | |
run: git diff --exit-code |