Skip to content

workflows: bump codecov/codecov-action from 4.3.1 to 4.4.1 #240

workflows: bump codecov/codecov-action from 4.3.1 to 4.4.1

workflows: bump codecov/codecov-action from 4.3.1 to 4.4.1 #240

Workflow file for this run

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@v5
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/codecov-action@v4.4.1
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://github.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 }}