fix(ci): semgrep, cov-comment, buf-break-no-fail #88
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: Tests | |
on: | |
# for write permission, use pull_request_target and not pull_request. | |
pull_request_target: | |
push: | |
branches: | |
- develop | |
- main | |
- master | |
- release/** | |
permissions: | |
contents: write | |
pull-requests: write | |
# Automatically cancel run if another commit to the same ref is detected. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-unit-cover: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
check-latest: true | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: technote-space/get-diff-action@v6.1.2 | |
with: | |
PATTERNS: | | |
**/**.sol | |
**/**.go | |
go.mod | |
go.sum | |
- name: Test and create coverage report | |
run: | | |
make test-unit-cover | |
if: env.GIT_DIFF | |
- name: Check if test coverage is above threshold | |
id: output-coverage | |
uses: vladopajic/go-test-coverage@v2 | |
with: | |
profile: cover.out | |
local-prefix: github.com/ExocoreNetwork/exocore | |
# TODO: increase this threshold with time to 80 | |
threshold-total: 10 | |
if: env.GIT_DIFF | |
- name: Find comment | |
id: find-comment | |
uses: peter-evans/find-comment@v2 | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
if: env.GIT_DIFF && github.event_name == 'pull_request' | |
- name: Comment coverage on PR | |
uses: peter-evans/create-or-update-comment@v3 | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-id: ${{ steps.find-comment.outputs.comment-id }} | |
body: | | |
Coverage as of ${{ github.sha }}: ${{ steps.output-coverage.outputs.total-coverage }}% | |
edit-mode: append | |
if: env.GIT_DIFF && github.event_name == 'pull_request' |