Skip to content

chore(deps): update codecov/codecov-action action to v4.4.0 (#1042) #1341

chore(deps): update codecov/codecov-action action to v4.4.0 (#1042)

chore(deps): update codecov/codecov-action action to v4.4.0 (#1042) #1341

Workflow file for this run

name: test & tag
on:
merge_group:
pull_request:
push:
branches:
- "main"
tags-ignore:
- "v*"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- name: Set up go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
# renovate: go-version
go-version: 1.22.2
- name: Run go tests
run: |
go test ./... -race -covermode=atomic -coverprofile=coverage.out
- name: Upload coverage to Codecov
uses: codecov/codecov-action@6d798873df2b1b8e5846dba6fb86631229fbcb17 # v4.4.0
with:
files: coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
# This builds the binary and starts it. If it does not exit within 3 seconds, consider it
# successful
#
# With this, we prevent regressions like in 9c9e365c6ada93d94e90eae85704f14b8afaa4c9.
- name: Verify binary works
run: |
make build
API_URL=https://example.com/api timeout 3 ./backend || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
tag:
runs-on: ubuntu-latest
needs: test
if: github.repository == 'envelope-zero/backend' && github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
with:
fetch-depth: 0
token: ${{ secrets.EZ_BOT_TOKEN }}
- name: Install svu
run: |
# renovate: datasource=github-releases depName=caarlos0/svu
export SVU_VERSION="v1.12.0"
curl -Lo ./svu.tar.gz "https://github.com/caarlos0/svu/releases/download/${SVU_VERSION}/svu_${SVU_VERSION#v}_linux_amd64.tar.gz"
tar -C "$HOME" -xzf svu.tar.gz
rm svu.tar.gz
- name: Tag new version
run: |
if [ $(git tag -l "$(~/svu next)") ]; then
echo "Tag already exists, no release necessary"
else
echo "Tagging new version"
git tag "$(~/svu next)"
git push --tags
fi