Skip to content

Bump actions/upload-artifact from 4.4.3 to 4.5.0 #126

Bump actions/upload-artifact from 4.4.3 to 4.5.0

Bump actions/upload-artifact from 4.4.3 to 4.5.0 #126

Workflow file for this run

name: Lint & Test 🕵️‍♂️
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
concurrency:
group: golangci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
jobs:
golangci:
name: Golang CI 🧹
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go 🐹
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: "1.22"
cache: false
- name: golangci-lint 🕵️‍♂️
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
version: v1.54
unittest:
name: Unit Test 🧪
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go 🐹
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: "1.22"
cache: false
- name: Install gocover-cobertura 📦
run: |
go get github.com/boumenot/gocover-cobertura && go install github.com/boumenot/gocover-cobertura
- name: Set up gotestfmt 📦
uses: GoTestTools/gotestfmt-action@8b4478c7019be847373babde9300210e7de34bfb # v2.2.0
- name: Run tests 🧪
run: sudo go test -race -json -v -coverprofile=coverage.txt ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
- name: Convert go coverage to corbetura format 🔄
run: gocover-cobertura < coverage.txt > coverage.xml
- name: Upload coverage reports to Codecov ☂️
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
slug: pedrojreis/ScrumChrono
with:
files: ./coverage.xml
- name: Generate code coverage report 📊
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
with:
filename: coverage.xml
badge: false
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: true
indicators: true
output: both
thresholds: "60 80"
- name: Add Coverage PR Comment 📌
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31 # v2.9.0
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
# Upload the original go test log as an artifact for later review.
- name: Upload test log 📤
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error