Skip to content

Commit

Permalink
Swap to GitHub CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Doridian committed Sep 1, 2022
1 parent 642ab2d commit f6bfa17
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 38 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
on:
push:
branches: main
pull_request:
types: [opened, reopened, synchronize]
workflow_call: {}

name: Check

jobs:
imports:
name: Imports
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check
uses: jo-fr/golang-github-actions@master
with:
run: imports
token: ${{ secrets.GITHUB_TOKEN }}

errcheck:
name: Errcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check
uses: jo-fr/golang-github-actions@master
with:
run: errcheck
token: ${{ secrets.GITHUB_TOKEN }}

shadow:
name: Shadow
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check
uses: jo-fr/golang-github-actions@master
with:
run: shadow
token: ${{ secrets.GITHUB_TOKEN }}

staticcheck:
name: StaticCheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check
uses: jo-fr/golang-github-actions@master
with:
run: staticcheck
token: ${{ secrets.GITHUB_TOKEN }}
flags: --checks all,-ST1000

sec:
name: Sec
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check
uses: jo-fr/golang-github-actions@master
with:
run: sec
token: ${{ secrets.GITHUB_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
push:
branches: main
pull_request:
types: [opened, reopened, synchronize]
workflow_call: {}

name: Test

jobs:
test-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Build
run: go build ./...
- name: Test
run: go test ./...

test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Build
run: go build ./...
- name: Test
run: go test ./...

test-darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Build
run: go build ./...
- name: Test
run: go test ./...
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

23 changes: 0 additions & 23 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ func FindLowestNetworkInterfaceByPrefix(prefix string) string {
if !NetworkInterfaceExists(ifaceName) {
return ifaceName
}
i += 1
i++
}
}
1 change: 0 additions & 1 deletion waterutil/tun_ipv4.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ func IPv4Payload(packet []byte) []byte {
return packet[ihl*4:]
}

// For TCP/UDP
func IPv4SourcePort(packet []byte) uint16 {
payload := IPv4Payload(packet)
return (uint16(payload[0]) << 8) | uint16(payload[1])
Expand Down

0 comments on commit f6bfa17

Please sign in to comment.