Skip to content

updating action

updating action #20

Workflow file for this run

name: Main
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.22.x
cache: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout 5m --verbose
skip-cache: false
skip-pkg-cache: false
skip-build-cache: false
only-new-issues: true
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.22.x
cache: false
- name: run test
run: |
go test -v --race -timeout 15m -coverprofile=./cover.out -json ./... > tests.log
- name: convert coverage to html
run: go tool cover -html=cover.out -o cover.html
- name: print test report
run: |
set -o pipefail && cat tests.log | node .github/parse-tests.js >> $GITHUB_STEP_SUMMARY
echo $GITHUB_STEP_SUMMARY
- name: print coverage result
run: |
go tool cover -func=cover.out > ./cover.txt
echo "<details><summary>📏 Tests coverage</summary>" >> $GITHUB_STEP_SUMMARY
echo -e "\n\`\`\`" >> $GITHUB_STEP_SUMMARY
cat ./cover.txt >> $GITHUB_STEP_SUMMARY
echo -e "\`\`\`\n</details>" >> $GITHUB_STEP_SUMMARY
- name: store code coverage artifact
uses: actions/upload-artifact@v3
with:
name: report
path: |
tests.log
cover.txt
cover.out
cover.html