forked from insomniacslk/dhcp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TravisCI not supported anymore. Signed-off-by: Andrea Barberio <[email protected]>
- Loading branch information
1 parent
28f7414
commit c510608
Showing
7 changed files
with
157 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: latest | ||
|
||
# Optional: golangci-lint command line arguments. | ||
# args: --issues-exit-code=0 | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true | ||
|
||
# Optional: if set to true then the action will use pre-installed Go | ||
# skip-go-installation: true | ||
# checklicenses: | ||
# name: checklicenses | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: check license headers | ||
# run: | | ||
# set -exu | ||
# go get -u github.com/u-root/u-root/tools/checklicenses | ||
# $(go env GOPATH)/bin/checklicenses -c .ci/checklicenses_config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.13', '1.14', '1.15', '1.16'] | ||
env: | ||
GO111MODULE: on | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
stable: false | ||
go-version: ${{ matrix.go }} | ||
- name: run unit tests | ||
run: | | ||
go get -v -t ./... | ||
echo "" > "${GITHUB_WORKSPACE}"/coverage.txt | ||
for d in $(go list ./...); do | ||
go test -v -race -coverprofile=profile.out -covermode=atomic "${d}" | ||
if [ -f profile.out ]; then | ||
cat profile.out >> "${GITHUB_WORKSPACE}"/coverage.txt | ||
rm profile.out | ||
fi | ||
done | ||
- name: report coverage to codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
files: coverage.txt | ||
flags: unittests | ||
fail_ci_if_error: true | ||
verbose: true | ||
integration-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: ['1.13', '1.14', '1.15', '1.16'] | ||
env: | ||
GO111MODULE: on | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
stable: false | ||
go-version: ${{ matrix.go }} | ||
- name: run integ tests | ||
run: | | ||
go get -v -t -tags=integration ./... | ||
echo "" > "${GITHUB_WORKSPACE}"/coverage.txt | ||
for d in $(go list -tags=integration ./...); do | ||
go test -c -tags=integration -v -race -coverprofile=profile.out -covermode=atomic "${d}" | ||
testbin="./$(basename $d).test" | ||
# only run it if it was built - i.e. if there are integ tests | ||
test -x "${testbin}" && sudo "./${testbin}" | ||
if [ -f profile.out ]; then | ||
cat profile.out >> "${GITHUB_WORKSPACE}"/coverage.txt | ||
rm profile.out | ||
fi | ||
done | ||
- name: report coverage to codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
files: coverage.txt | ||
flags: integtests | ||
fail_ci_if_error: true | ||
verbose: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters