ci: use github actions

This commit is contained in:
Aleksandr Razumov
2020-11-01 18:27:40 +03:00
parent b5cadfb122
commit d62c688d1f
7 changed files with 198 additions and 47 deletions

View File

@@ -1,25 +0,0 @@
version: "{build}"
platform:
- x64
- x86
branches:
only:
- master
skip_tags: true
clone_folder: c:\gortc\stun
environment:
GOPATH: c:\gopath
GOVERSION: 1.14
install:
- go version
- go get -v -t .
build_script:
- go vet ./...
- go test -v .

15
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
- package-ecosystem: docker
directory: "/e2e"
schedule:
interval: weekly

26
.github/stale.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 366
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 30
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
- bug
- blocked
- protected
- triaged
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

58
.github/workflows/codeql.yaml vendored Normal file
View File

@@ -0,0 +1,58 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '0 17 * * 5'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: [ 'go' ]
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Use manual build instead of auto build
- run: make test
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

19
.github/workflows/pr-extra.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Extra
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
vulns:
name: Vulnerability scanner
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- name: Run go list
run: go list -json -m all > go.list
- name: Nancy
uses: sonatype-nexus-community/nancy-github-action@1.0.1

80
.github/workflows/pr.yml vendored Normal file
View File

@@ -0,0 +1,80 @@
---
name: CI
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
# Check if there any dirty change for go mod tidy
go-mod:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Checkout code
uses: actions/checkout@v2
- name: Check go mod
run: |
go mod tidy
git diff --exit-code go.mod
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: lint
uses: golangci/golangci-lint-action@v2.3.0
with:
version: latest
tests-on-windows:
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15 # test only the latest go version to speed up CI
- name: Run tests
run: make.exe test
continue-on-error: true
tests-on-macos:
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.15 # test only the latest go version to speed up CI
- name: Run tests
run: make test
tests-on-unix:
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
runs-on: ubuntu-latest
strategy:
matrix:
golang:
- 1.13
- 1.14
- 1.15
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.golang }}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.golang }}-
- name: Run tests
run: make test

View File

@@ -1,22 +0,0 @@
language: go
sudo: false
env:
- GO111MODULE=on
os:
- linux
- osx
go:
- 1.13.x
- 1.14.x
install: true
script:
- make test
after_success:
- bash <(curl -s https://codecov.io/bash)