[FEAT] buffered channel drain single collect #192
Workflow file for this run
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: [main] | |
tags: | |
- "v*" | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build and test | |
permissions: | |
contents: read | |
packages: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- run: | | |
CMETRICS_VERSION=$(sed -n 's/^ARG CMETRICS_VERSION=\(.*\)/\1/p' testdata/Dockerfile) | |
CMETRICS_RELEASE=$(sed -n 's/^ARG CMETRICS_RELEASE=\(.*\)/\1/p' testdata/Dockerfile) | |
echo "Using release: CMETRICS_RELEASE" | |
echo "Using version: CMETRICS_VERSION" | |
wget https://github.com/calyptia/cmetrics/releases/download/${CMETRICS_RELEASE}/cmetrics_${CMETRICS_VERSION}_${TARGETARCH}-headers.deb | |
wget https://github.com/calyptia/cmetrics/releases/download/${CMETRICS_RELEASE}/cmetrics_${CMETRICS_VERSION}_${TARGETARCH}.deb | |
sudo dpkg -i *.deb | |
rm *.deb | |
shell: bash | |
env: | |
TARGETARCH: amd64 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.21" | |
- name: Go mod download | |
run: go mod download | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.CI_USERNAME }} | |
password: ${{ secrets.CI_PAT }} | |
- name: Cache Golang Docker Image | |
run: docker pull golang:latest | |
- name: Cache ghcr.io/calyptia/internal/core-fluent-bit Docker Image | |
run: docker pull ghcr.io/calyptia/internal/core-fluent-bit:main | |
- name: Unit tests | |
run: | | |
# go test -v -covermode=atomic -coverprofile=coverage.out ./... | |
go test -v -covermode=atomic -coverprofile=coverage.out \ | |
-run \^TestInputCallbackCtrlC\$ ./ | |
go test -v -covermode=atomic -coverprofile=coverage.out \ | |
-run \^TestInputCallbackDangle\$ ./ | |
go test -v -covermode=atomic -coverprofile=coverage.out \ | |
-run \^TestInputCallbackInfinite\$ ./ | |
go test -v -covermode=atomic -coverprofile=coverage.out \ | |
-run \^TestInputCallbackInfiniteLatency\$ ./ | |
go test -v -covermode=atomic -coverprofile=coverage.out \ | |
-run \^TestInputCallbackInfiniteConcurrent\$ ./ | |
go test -v -covermode=atomic -coverprofile=coverage.out \ | |
-run \^TestPlugin\$ ./ | |
go test -v -covermode=atomic -coverprofile=coverage.out \ | |
-run \^TestInputCallbackInfiniteConcurrent\$ ./ | |
go test -v -covermode=atomic -coverprofile=coverage.out \ | |
./configloader/ | |
go test -v -covermode=atomic -coverprofile=coverage.out \ | |
./output/ | |
- name: Upload coverage to Codecov | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: codecov/[email protected] | |
with: | |
file: ./coverage.out | |
flags: ${{ runner.os }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Install Syft for sboms | |
if: ${{ github.event_name != 'pull_request' }} | |
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin | |
shell: bash | |
- name: Import GPG key | |
if: ${{ github.event_name != 'pull_request' }} | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.CALYPTIA_GPG_KEY }} | |
passphrase: ${{ secrets.CALYPTIA_GPG_KEY_PASSPHRASE }} | |
- name: Run GoReleaser | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
version: latest | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_PAT }} | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} |