From 92e204212ed7387b9dbd7276932d092fa5798eaf Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 15:06:34 -0800 Subject: [PATCH 01/11] Create main.yml adding github action for testing --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..be0eeee --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: setup up GO + uses: actionssetup-go@v2 + with: + go-version: 1.17 + + # Runs a set of commands using the runners shell + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... From a43c99d699b12c59f6fa0b0f864e79f50a8e1bbd Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 15:08:08 -0800 Subject: [PATCH 02/11] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be0eeee..1f9a1cf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: # Runs a single command using the runners shell - name: setup up GO - uses: actionssetup-go@v2 + uses: actions/setup-go@v2 with: go-version: 1.17 From 5d7f9d9745c4ce9bfe2336261da26b21b9df6276 Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 15:10:22 -0800 Subject: [PATCH 03/11] Update main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1f9a1cf..fbb81f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,6 +31,8 @@ jobs: with: go-version: 1.17 + - name: download dep + run: go mod tidy # Runs a set of commands using the runners shell - name: Build run: go build -v ./... From 1644a11b87aa73a8bd455c3e2432158adbb5a0d5 Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 15:14:32 -0800 Subject: [PATCH 04/11] Update main.yml --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fbb81f2..17fd179 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,8 +30,9 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.17 - - - name: download dep + - name: install dep + run: apt-get -y install libpcap-dev + - name: download go dep run: go mod tidy # Runs a set of commands using the runners shell - name: Build From 95d92aebf442ac86714607d596346a9e9181deb6 Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 15:16:06 -0800 Subject: [PATCH 05/11] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 17fd179..b18bec9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: with: go-version: 1.17 - name: install dep - run: apt-get -y install libpcap-dev + run: sudo apt-get -y install libpcap-dev - name: download go dep run: go mod tidy # Runs a set of commands using the runners shell From 779e66e432187ea0611278e7f946c705b59dcda8 Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 15:17:26 -0800 Subject: [PATCH 06/11] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b18bec9..e3167ac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,4 +39,4 @@ jobs: run: go build -v ./... - name: Test - run: go test -v ./... + run: go test -v From b75a258833c5f5e4f9b1e05861c3a3f58c6810b0 Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 15:18:40 -0800 Subject: [PATCH 07/11] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3167ac..55f421f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,4 +39,4 @@ jobs: run: go build -v ./... - name: Test - run: go test -v + run: sudo go test -v From 76306133cac2a7dad8b28a7a0442204e72da65fa Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 16:21:49 -0800 Subject: [PATCH 08/11] Update main.yml --- .github/workflows/main.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 55f421f..b0c8e47 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,10 +33,8 @@ jobs: - name: install dep run: sudo apt-get -y install libpcap-dev - name: download go dep - run: go mod tidy - # Runs a set of commands using the runners shell - - name: Build - run: go build -v ./... + run: go get -t -v ./... + - name: Test - run: sudo go test -v + run: sudo -E env "PATH=$PATH" go test -v From 3a23d3e70d2c98e9143bd072650f17beac70fcbc Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 16:24:01 -0800 Subject: [PATCH 09/11] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b0c8e47..a306cdc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: with: go-version: 1.17 - name: install dep - run: sudo apt-get -y install libpcap-dev + run: sudo apt-get -y install libpcap-dev kea-dhcp4-server kea-dhcp6-server - name: download go dep run: go get -t -v ./... From dfb58bf6093af158609e9838d76f94f93d510606 Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 16:26:21 -0800 Subject: [PATCH 10/11] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a306cdc..cc8275f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,4 +37,4 @@ jobs: - name: Test - run: sudo -E env "PATH=$PATH" go test -v + run: sudo -E env "PATH=$PATH" go test -failfast -p 1 -v From 20ccb1cbe749bc4764f8177e78a9155a6b5364c0 Mon Sep 17 00:00:00 2001 From: Hu Jun Date: Fri, 25 Feb 2022 16:33:53 -0800 Subject: [PATCH 11/11] change ci badge --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d2ae714..8854611 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # dhcplt -[![Build Status](https://travis-ci.org/hujun-open/dhcplt.svg?branch=master)](https://travis-ci.org/hujun-open/dhcplt) +![Build Status](https://github.com/hujun-open/dhcplt/actions/workflows/main.yml/badge.svg) dhcplt is a DHCPv4/DHCPv6 load tester for Linux with following features: @@ -168,4 +168,4 @@ Usage of ./dhcplt: - -v6m: setting the DHCPv6 message type: - solicit - relay - - auto: if rid or cid is specified, then it is relay; otherwise solict \ No newline at end of file + - auto: if rid or cid is specified, then it is relay; otherwise solict