Skip to content

Commit

Permalink
Up github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
demdxx committed Jul 10, 2024
1 parent 5e63c8b commit 8fc28f4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
58 changes: 38 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,73 @@
on: [push, pull_request]
# push:
# branches:
# - master
# pull_request:
# branches:
# - master
name: Tests

on:
push:
tags:
- v*
branches:
- master
- main
pull_request:
branches:
- master
- main

name: run tests
jobs:
lint:
runs-on: ubuntu-latest

permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write

steps:
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16.x
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run linters
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v6
with:
version: v1.29
version: v1.59.1
skip-cache: true
args: --fix

test:
needs: lint
strategy:
matrix:
go-version: [1.16.x, 1.17.x]
go-version: [1.22.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
if: success()
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run tests
run: go test -v -covermode=count
run: go test -v -covermode=count ./...

coverage:
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:
go-version: [1.16.x, 1.17.x]
go-version: [1.22.x]
steps:
- uses: actions/setup-go@v1
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: go test -v -coverprofile=profile.cov ./...
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# UDetect protocol

[![Build Status](https://github.com/geniusrabbit/udetect/workflows/run%20tests/badge.svg)](https://github.com/geniusrabbit/udetect/actions?workflow=run%20tests)
[![Build Status](https://github.com/geniusrabbit/udetect/workflows/Tests/badge.svg)](https://github.com/geniusrabbit/udetect/actions?workflow=Tests)
[![Go Report Card](https://goreportcard.com/badge/github.com/geniusrabbit/udetect)](https://goreportcard.com/report/github.com/geniusrabbit/udetect)
[![GoDoc](https://godoc.org/github.com/geniusrabbit/udetect?status.svg)](https://godoc.org/github.com/geniusrabbit/udetect)
[![Coverage Status](https://coveralls.io/repos/github/sspserver/udetect/badge.svg)](https://coveralls.io/github/sspserver/udetect)
Expand Down

0 comments on commit 8fc28f4

Please sign in to comment.