Skip to content

chore(deps): update codecov/codecov-action action to v5 #2209

chore(deps): update codecov/codecov-action action to v5

chore(deps): update codecov/codecov-action action to v5 #2209

Workflow file for this run

---
name: build-and-test
on:
pull_request:
branches: [main]
paths:
- '**/Dockerfile'
- '**/.dockerignore'
- .github/**
- '**.go'
- '**.mod'
- '**.sum'
- config/**
- '**/Makefile*'
- '**/documentation.md'
- .golangci.yaml
- .goreleaser.yaml
push:
branches: [main]
jobs:
lint:
if: github.actor != 'liatrio-otel-collector-release[bot]'
strategy:
matrix:
go: ['1.23']
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: false
- name: Make install-tools
run: make install-tools
- name: Make lint-all
run: make lint-all
- name: Check Code Generation
run: |
make generate
git diff -s --exit-code || (echo 'Generated code is out of date. Run make generate and commit the changes' && exit 1)
- name: Check packages are up-to-date
run: |
make tidy-all
git diff -s --exit-code || (echo 'Packages are out of date. Run make tidy-all and commit the changes' && exit 1)
- name: Check crosslink run
run: |
make crosslink
git diff -s --exit-code || (echo 'Replace statements not updated. Run make crosslink and commit the changes' && exit 1)
build:
name: build
if: github.actor != 'liatrio-otel-collector-release[bot]'
strategy:
matrix:
GOOS: [darwin, linux, windows]
GOARCH: [arm64, amd64, '386']
go: ['1.23']
exclude:
- GOOS: darwin
GOARCH: '386'
- GOOS: darwin
GOARCH: arm
- GOOS: windows
GOARCH: arm
- GOOS: windows
GOARCH: arm64
runs-on:
group: bigger
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Build
env:
GGOOS: ${{ matrix.GOOS }}
GGOARCH: ${{ matrix.GOARCH }}
run: make build
# - name: Run GoReleaser
# uses: goreleaser/goreleaser-action@v6
# if: steps.cache.outputs.cache-hit != 'true'
# with:
# distribution: goreleaser-pro
# version: latest
# args: release --clean --snapshot --split
# env:
# GGOOS: ${{ matrix.GOOS }}
# GGOARCH: ${{ matrix.GOARCH }}
# GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
test:
if: github.actor != 'liatrio-otel-collector-release[bot]'
strategy:
matrix:
go: ['1.23']
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: false
- name: Make test-all
run: make test-all
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
multimod-prepare-release:
if: ${{ github.ref == 'refs/heads/main' && github.actor != 'liatrio-otel-collector-release[bot]' }}
needs: [lint, build]
runs-on:
group: bigger
permissions:
contents: write
steps:
- name: Generate a token
# if: steps.get_next_version.outputs.hasNextVersion == 'true'
id: generate_token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Clone repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ steps.generate_token.outputs.token }}
fetch-depth: 0
- name: Install tools
run: make install-tools
- name: Get next version
id: get_next_version
uses: thenativeweb/get-next-version@29245d291b9f64a41d76f9b41683610bb4ffeccc # 2.6.3
with:
prefix: v # optional, defaults to ''
- name: Show the next version
run: |
echo ${{ steps.get_next_version.outputs.version }}
echo ${{ steps.get_next_version.outputs.hasNextVersion }}
- name: Get GitHub App User ID
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.generate_token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
- name: Multimod release #This is so multimod prerelease can get author info
if: steps.get_next_version.outputs.hasNextVersion == 'true'
run: |
set -eo pipefail
git config --global user.name '${{ steps.generate_token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.generate_token.outputs.app-slug }}[bot]@users.noreply.github.com'
yq -i '.module-sets.liatrio-otel.version = "${{ steps.get_next_version.outputs.version }}"' versions.yaml
git add .
git commit -m "chore: run multimod to update versions ahead of release(version ${{ steps.get_next_version.outputs.version }})"
make multimod-prerelease
git push