actions
This commit is contained in:
parent
436c94704c
commit
b9045bbd12
|
@ -0,0 +1,35 @@
|
|||
name: Security
|
||||
|
||||
env:
|
||||
TZ: Etc/GMT-8
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
scan:
|
||||
strategy:
|
||||
matrix:
|
||||
go: ['>=1.19.8']
|
||||
fail-fast: true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Setup Go ${{ matrix.go }}
|
||||
uses: https://github.com/actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
cache: false
|
||||
|
||||
- name: Run GoSec
|
||||
uses: https://github.com/securego/gosec@master
|
||||
with:
|
||||
args: ./...
|
|
@ -0,0 +1,35 @@
|
|||
name: Test
|
||||
|
||||
env:
|
||||
TZ: Etc/GMT-8
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
uint:
|
||||
strategy:
|
||||
matrix:
|
||||
go: ['>=1.19.8']
|
||||
os: [ubuntu-latest]
|
||||
fail-fast: true
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Setup Go ${{ matrix.go }}
|
||||
uses: https://github.com/actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
cache: false
|
||||
|
||||
- name: Run Tests
|
||||
run: go test -race -cover -coverprofile=coverage -covermode=atomic -v ./...
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
name: Verify
|
||||
|
||||
env:
|
||||
TZ: Etc/GMT-8
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
lint:
|
||||
strategy:
|
||||
matrix:
|
||||
go: ['>=1.19.8']
|
||||
fail-fast: true
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
|
||||
- name: Setup Go ${{ matrix.go }}
|
||||
uses: https://github.com/actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go }}
|
||||
cache: false
|
||||
|
||||
- name: Run GolangCI-Lint
|
||||
uses: https://github.com/golangci/golangci-lint-action@v3
|
||||
with:
|
||||
version: v1.54
|
||||
args: --timeout=5m
|
||||
|
|
@ -2,6 +2,15 @@
|
|||
|
||||
自用的golang日志库
|
||||
|
||||
[![GoReport](https://goreportcard.com/badge/git.viry.cc/gomod/glog)](https://goreportcard.com/report/git.viry.cc/gomod/glog)
|
||||
[![Gitea Release](https://img.shields.io/gitea/v/release/gomod/glog?gitea_url=https%3A%2F%2Fgit.viry.cc)](https://git.viry.cc/gomod/glog/releases/latest)
|
||||
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)
|
||||
[![Go.Dev reference](https://img.shields.io/badge/go.dev-reference-blue?logo=go&logoColor=white)](https://pkg.go.dev/git.viry.cc/gomod/glog?tab=doc)
|
||||
|
||||
```go
|
||||
import "git.viry.cc/gomod/glog"
|
||||
```
|
||||
|
||||
# 类型
|
||||
|
||||
使用`SetMask(m int)`设置每种消息是否输出
|
||||
|
|
Loading…
Reference in New Issue