Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
feat: add CI tests (#15)
Browse files Browse the repository at this point in the history
* add ci test

* remove test coverage
  • Loading branch information
Pantani authored Oct 8, 2021
1 parent d7409a6 commit ca8feea
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint
on:
pull_request:
push:
branches:
- master
- develop
jobs:
lint:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v4
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- uses: golangci/golangci-lint-action@master
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.37
args: --issues-exit-code=0 -e SA1019 --timeout 10m
github-token: ${{ secrets.github_token }}
if: env.GIT_DIFF
16 changes: 16 additions & 0 deletions .github/workflows/test-semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: PR Semantic

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
semantic_pr:
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Unit Tests

on:
pull_request:
push:
paths-ignore:
- '*.md'
branches:
- master
- develop


jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Run unit tests
run: go test -v ./...

0 comments on commit ca8feea

Please sign in to comment.