Skip to content

Commit 54e6cf0

Browse files
committed
👷 [CI] Use GitHub instead of Travis.
Signed-off-by: Oliver Tale-Yazdi <oliver@perun.network>
1 parent cf9279c commit 54e6cf0

File tree

3 files changed

+51
-47
lines changed

3 files changed

+51
-47
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- master
8+
tags:
9+
pull_request:
10+
release:
11+
12+
jobs:
13+
build:
14+
name: CI
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Set up Go 1.x
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: ^1.15
21+
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Copyright notice
28+
run: |
29+
.scripts/check-copyright-notice.sh
30+
.scripts/check-notice-authors.sh origin/master
31+
32+
- name: Dependencies
33+
run: |
34+
go get -v -t -d ./...
35+
docker pull golangci/golangci-lint:v1.27
36+
37+
- name: Vanity import
38+
run: .scripts/check-vanity-imports.sh $GITHUB_WORKSPACE
39+
40+
- name: Vetting
41+
run: docker run --rm -v $GITHUB_WORKSPACE:/app -w /app golangci/golangci-lint:v1.27 golangci-lint run
42+
43+
- name: Unit Tests
44+
run: go test -timeout 60s ./...
45+
46+
- name: Unit Race Tests
47+
run: go test -timeout 120s -race -gcflags=all=-d=checkptr=0 ./...

.scripts/check-notice-authors.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@ exit_code=0
2525
# Call with an ancestor whereas all commits newer than the ancestor are checked.
2626
base="$1"
2727
if [ -z "$base" ]; then
28-
commits="$(git rev-list --reverse HEAD)"
28+
commits="$(git rev-list --no-merges --reverse HEAD)"
2929
else
30-
commits="$(git rev-list --reverse $base..HEAD)"
30+
commits="$(git rev-list --no-merges --reverse $base..HEAD)"
3131
fi
3232

33+
echo "Current commit: $(git rev-parse HEAD)"
3334
# Authors found in commits and NOTICE.
3435
declare -A known_authors
3536
# Authors found only in commits but not NOTICE file.
3637
declare -A assumed_authors
3738

3839
for c in $commits; do
40+
echo "Checking commit: $c"
3941
author=$(git show -s --format='%an <%ae>' $c)
4042
# Check Signed-Off-By message
4143
if ! git show -s --format='%B' $c | grep -wq "Signed-off-by: $author"; then

.travis.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)