Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Update README.md

Update README.md #38

Workflow file for this run

name: CI
# ~~
# https://github.com/kunitsuinc/rec.go/workflows/CI/badge.svg
# ~~
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs: {}
defaults:
run:
shell: bash
jobs:
ci:
name: CI
# cf. https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# cf. https://github.com/actions/setup-go#usage
- uses: actions/setup-go@v3
with:
go-version-file: go.mod
# cf. https://github.com/actions/cache/blob/main/examples.md#go---modules
- uses: actions/cache@v3
id: cache
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# cf. https://github.com/actions/cache#skipping-steps-based-on-cache-hit
- name: Run go mod tidy
if: steps.cache.outputs.cache-hit != 'true'
run: |
go mod tidy
git diff --exit-code go.mod go.sum
# cf. https://github.com/golangci/golangci-lint-action#how-to-use
- uses: golangci/golangci-lint-action@v3.3.1
with:
version: latest
- name: Run go test
env:
COLOR: true
run: |
go test -v -race -p=4 -parallel=8 -timeout=300s -cover -coverprofile=./coverage.txt ./...
go tool cover -func=./coverage.txt
# cf. https://github.com/codecov/codecov-action#example-workflowyml-with-codecov-action
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.txt