build(deps): bump codecov/codecov-action from 3 to 4 #44
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: Unit Test | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.3.0 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.x | |
- name: Config private packages | |
run: git config --global url.https://${{ secrets.ACCESS_TOKEN }}@github.com/Drafteame.insteadOf https://github.com/Drafteame | |
- name: Checkout | |
uses: actions/checkout@v3.3.0 | |
- name: Install dependencies | |
run: go mod download | |
- name: Set up gotestfmt | |
uses: gotesttools/gotestfmt-action@v2 | |
with: | |
token: "${{ secrets.ACCESS_TOKEN }}" | |
- name: Test | |
run: | | |
set -euo pipefail | |
go test -json -v -race -cover -coverprofile=coverage.out ./... 2>&1 | tee /tmp/gotest.log | gotestfmt | |
- name: Convert out to xml | |
run: | | |
go install github.com/axw/gocov/gocov@latest | |
go install github.com/AlekSi/gocov-xml@latest | |
gocov convert coverage.out | gocov-xml > coverage.xml | |
- name: Review coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
fail_ci_if_error: false | |
verbose: true | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3.3.0 | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.x | |
- name: Config private packages | |
run: git config --global url.https://${{ secrets.ACCESS_TOKEN }}@github.com/Drafteame.insteadOf https://github.com/Drafteame | |
- name: Install dependencies | |
run: go mod download | |
- name: Run Linter | |
uses: morphy2k/revive-action@v2 | |
with: | |
exclude: "magefiles/..." | |
config: revive.toml | |
commit_lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
token: '${{ secrets.ACCESS_TOKEN }}' | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Commitizen | |
run: pip install -U commitizen | |
- name: Check commits | |
run: cz check --rev-range origin/main..HEAD |