Giter VIP home page Giter VIP logo

actionsdemo's Introduction

[toc]

ActionsDemo

Go Release codecov

github actions

Actions yml文件语法

  • 当代码推送到 master和 release分支的时候触发构建
on:
  push:
    branches:
    - master
    - release/*
  • 当只有 pull_request被合并到 master分支的时候:
on:
  pull_request:
    branches:
    - master
  • 比如星期一到星期五的每天2点构建任务呢:
on:
  schedule:
  - cron: 0 2 * * 1-5

goreleaser 生成

go install github.com/goreleaser/goreleaser@latest
goreleaser init
goreleaser build --single-target
goreleaser release --snapshot 

徽章

CI&CD 徽章

Go

https://github.com/NicholeGit/ActionsDemo/workflows/Go/badge.svg
  • https://github.com/NicholeGit/ActionsDemo/ 是项目的地址
  • workflows/Go/badge.svg 中间的 Go 是 https://github.com/NicholeGit/ActionsDemo/actions 下的名称。需要注意区分大小写

Release 徽章

Release

  • 需要创建 release 版本才出现

测试覆盖率 徽章

codecov

  • 编写.travis.yml 文件
language: go # 使用语言.
go: 
  - 1.15.6  # 版本号, 支持多种版本号

sudo: required #  #有定制化开发环境需要,默认false,不开启容器,编译效率高 

os:            # 使用的操作系统 
  - linux
  - osx

notifications:  # 邮箱通知
  email: [email protected]

go_import_path: # 使用Go需要导入的包. 
  - github.com/gin-gonic/gin
  - github.com/pkg/errors
  - github.com/smartystreets/goconvey

before_install: # 主要安装一些系统依赖,
  - go mod tidy

install: true # 安装, true跳过

script: # 脚本执行.
  - echo "run"
  - go test -race -coverprofile=coverage.txt -covermode=atomic
  - go test -v ./...

after_success: # 上传测试报告
  - bash <(curl -s https://codecov.io/bash)

actionsdemo's People

Contributors

nicholegit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.