Skip to content

chore(lint): Fix super linter (again) #84

chore(lint): Fix super linter (again)

chore(lint): Fix super linter (again) #84

Workflow file for this run

name: Tests
on:
pull_request:
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
- 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
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: Extract coverage data
id: extract_coverage
run: |
echo "coverage=$(head -n 1 $GITHUB_ACTION | awk -F'=' '{print $2}')" >> $GITHUB_ENV
- 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: |
Total Coverage: ${{ env.coverage }}
edit-mode: replace
if: env.GIT_DIFF && github.event_name == 'pull_request'