This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/setup-go](https://github.com/actions/setup-go) | action | major | `v6` → `v7` | --- ### Release Notes <details> <summary>actions/setup-go (actions/setup-go)</summary> ### [`v7.0.0`](https://github.com/actions/setup-go/releases/tag/v7.0.0) [Compare Source](https://github.com/actions/setup-go/compare/v7.0.0...v7.0.0) ##### What's Changed - Migrate to ESM and upgrade dependencies by [@​priyagupta108](https://github.com/priyagupta108) in [#​763](https://github.com/actions/setup-go/pull/763) - chore(deps): bump [@​actions/cache](https://github.com/actions/cache) to 6.2.0 by [@​philip-gai](https://github.com/philip-gai) in [#​771](https://github.com/actions/setup-go/pull/771) ##### New Contributors - [@​philip-gai](https://github.com/philip-gai) made their first contribution in [#​771](https://github.com/actions/setup-go/pull/771) **Full Changelog**: <https://github.com/actions/setup-go/compare/v6...v7.0.0> ### [`v7`](https://github.com/actions/setup-go/compare/v6.5.0...v7.0.0) [Compare Source](https://github.com/actions/setup-go/compare/v6.5.0...v7.0.0) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDMuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI0My4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: #162 Co-authored-by: Renovate Bot <renovate@unbound.se> Co-committed-by: Renovate Bot <renovate@unbound.se>
82 lines
2.8 KiB
YAML
82 lines
2.8 KiB
YAML
name: otelsetup
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version: 'stable'
|
|
- name: Run tests
|
|
run: go test -race -coverprofile=coverage.txt ./...
|
|
|
|
- name: Check coverage
|
|
id: coverage
|
|
run: |
|
|
go install github.com/vladopajic/go-test-coverage/v2@latest
|
|
go-test-coverage --config ./.testcoverage.yml --github-action-output
|
|
- name: Download baseline coverage
|
|
if: gitea.event_name == 'pull_request'
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: coverage-baseline
|
|
path: ./baseline
|
|
continue-on-error: true
|
|
- name: Compare coverage
|
|
if: gitea.event_name == 'pull_request'
|
|
run: |
|
|
CURRENT="${{ steps.coverage.outputs.total-coverage }}"
|
|
if [ -f ./baseline/coverage.txt ]; then
|
|
BASE=$(cat ./baseline/coverage.txt)
|
|
echo "Base coverage: ${BASE}%"
|
|
echo "Current coverage: ${CURRENT}%"
|
|
if [ "$(echo "$CURRENT < $BASE" | bc -l)" -eq 1 ]; then
|
|
echo "::error::Coverage decreased from ${BASE}% to ${CURRENT}%"
|
|
exit 1
|
|
fi
|
|
echo "Coverage maintained or improved: ${BASE}% -> ${CURRENT}%"
|
|
else
|
|
echo "No baseline coverage found, skipping comparison"
|
|
echo "Current coverage: ${CURRENT}%"
|
|
fi
|
|
- name: Save coverage baseline
|
|
if: gitea.ref == 'refs/heads/main'
|
|
run: echo "${{ steps.coverage.outputs.total-coverage }}" > coverage.txt
|
|
- name: Upload coverage baseline
|
|
if: gitea.ref == 'refs/heads/main'
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: coverage-baseline
|
|
path: coverage.txt
|
|
retention-days: 90
|
|
- name: Post coverage comment
|
|
if: gitea.event_name == 'pull_request'
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
GITEA_URL: ${{ gitea.server_url }}
|
|
run: |
|
|
COVERAGE="${{ steps.coverage.outputs.total-coverage }}"
|
|
curl -X POST "${GITEA_URL}/api/v1/repos/${{ gitea.repository }}/issues/${{ gitea.event.pull_request.number }}/comments" \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-H "Content-Type: application/json" \
|
|
-d "{\"body\": \"## Coverage Report\n\nTotal coverage: **${COVERAGE}%**\"}"
|
|
|
|
vulnerabilities:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version: 'stable'
|
|
- name: Check vulnerabilities
|
|
run: |
|
|
go install golang.org/x/vuln/cmd/govulncheck@latest
|
|
govulncheck ./...
|