Skip to content

Commit

Permalink
[action] modify test workflow and add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dopey committed Mar 11, 2022
1 parent 31cf01b commit c6b83c2
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 47 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/go.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Create Release & Upload Assets

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
test:
name: Lint, Test, Build
runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.16', '1.17' ]
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
-
name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: 'v1.44.0'
args: --timeout=30m
-
name: Test, Build
id: lintTestBuild
run: V=1 make

create_release:
name: Create Release
needs: test
runs-on: ubuntu-20.04
steps:
-
name: Is Pre-release
id: is_prerelease
run: |
set +e
echo ${{ github.ref }} | grep "\-rc.*"
OUT=$?
if [ $OUT -eq 0 ]; then IS_PRERELEASE=true; else IS_PRERELEASE=false; fi
echo "::set-output name=IS_PRERELEASE::${IS_PRERELEASE}"
-
name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Test

on:
push:
tags-ignore:
- 'v*'
branches:
- "**"
pull_request:

jobs:
lintTestBuild:
name: Lint, Test, Build
runs-on: ubuntu-20.04
strategy:
matrix:
go: [ '1.16', '1.17' ]
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
-
name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: 'v1.44.0'
args: --timeout=30m
-
name: Test, Build
id: lintTestBuild
run: V=1 make ci
-
name: Codecov
uses: codecov/codecov-action@v1.2.1
if: matrix.go == '1.17'
with:
file: ./coverage.out
name: codecov-umbrella
fail_ci_if_error: true

0 comments on commit c6b83c2

Please sign in to comment.