Просмотр исходного кода

Convert CI from Travis to GitHub Actions

Test with Go 1.16+ because that's what go.mod declares.  Also check lints.
Benjamin Gilbert 2 лет назад
Родитель
Сommit
1b61458e2d
3 измененных файлов с 38 добавлено и 26 удалено
  1. 37 0
      .github/workflows/go.yml
  2. 0 25
      .travis.yml
  3. 1 1
      README.md

+ 37 - 0
.github/workflows/go.yml

@@ -0,0 +1,37 @@
+name: Go
+
+on:
+  push:
+    branches: [main]
+  pull_request:
+    branches: [main]
+
+permissions:
+  contents: read
+
+env:
+  SUDO_PERMITTED: 1
+
+jobs:
+  test:
+    name: Test
+    strategy:
+      matrix:
+        go-version: [1.16.x, 1.17.x, 1.18.x]
+    runs-on: ubuntu-latest
+    steps:
+    - name: Set up Go 1.x
+      uses: actions/setup-go@v2
+      with:
+        go-version: ${{ matrix.go-version }}
+    - name: Check out repository
+      uses: actions/checkout@v2
+    - name: Install dependencies
+      run: go get golang.org/x/tools/cmd/cover
+    - name: Run tests
+      run: ./test
+    - name: Run linter
+      uses: golangci/golangci-lint-action@v2
+      with:
+        version: v1.46.2
+        args: -E=gofmt --timeout=30m0s

+ 0 - 25
.travis.yml

@@ -1,25 +0,0 @@
-language: go
-sudo: required
-dist: trusty
-arch:
-  - AMD64
-  - ppc64le
-go:
-  - 1.9.x
-  - 1.10.x
-  - tip
-env:
-  global:
-    - TOOLS_CMD=golang.org/x/tools/cmd
-    - PATH=$GOROOT/bin:$PATH
-    - SUDO_PERMITTED=1
-
-matrix:
-  allow_failures:
-    - go: tip
-
-install:
- - go get golang.org/x/tools/cmd/cover
-
-script:
- - ./test

+ 1 - 1
README.md

@@ -1,7 +1,7 @@
 # go-iptables
 
 [![GoDoc](https://godoc.org/github.com/coreos/go-iptables/iptables?status.svg)](https://godoc.org/github.com/coreos/go-iptables/iptables)
-[![Build Status](https://travis-ci.org/coreos/go-iptables.png?branch=master)](https://travis-ci.org/coreos/go-iptables)
+[![Build status](https://github.com/coreos/go-iptables/actions/workflows/go.yml/badge.svg)](https://github.com/coreos/go-iptables/actions/workflows/go.yml)
 
 Go bindings for iptables utility.