From 52692f5af926199c120c0fd1b3ef8dc353f1d955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serdar=20Ormanl=C4=B1?= Date: Mon, 28 Sep 2020 11:15:51 +0200 Subject: [PATCH] github actions added MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Serdar Ormanlı --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ .github/workflows/build.yml | 31 ++++++++++++++++++ .github/workflows/release.yml | 31 ++++++++++++++++++ internal/protoparser/protoparser_test.go | 3 +- 5 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..5e48c9f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: proton build +on: + push: + branches: + - "*" + +jobs: + + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@master + + - name: Set up Go (1.15) + uses: actions/setup-go@v1 + with: + go-version: 1.15 + + - name: Linter + run: | + docker run --rm -v $(pwd):/data cytopia/golint -set_exit_status=1 ./... + + - name: Test + run: | + go test -v -race -coverprofile=coverage.txt -covermode=atomic -tags=integration ./... + + - name: Build + run: | + make build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f11424e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: proton release +on: + push: + tags: + - "*" + +jobs: + + release: + name: Release + runs-on: ubuntu-latest + + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@master + + - name: Unshallow + run: git fetch --prune --unshallow + + - name: Set up Go (1.15) + uses: actions/setup-go@v1 + with: + go-version: 1.15 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@master + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/internal/protoparser/protoparser_test.go b/internal/protoparser/protoparser_test.go index 567ce3d..64b218d 100644 --- a/internal/protoparser/protoparser_test.go +++ b/internal/protoparser/protoparser_test.go @@ -1,6 +1,7 @@ package protoparser import ( + "context" "net/http" "net/url" "path/filepath" @@ -115,7 +116,7 @@ func Test_HTTPParser(t *testing.T) { test.prepare() parse, err := url.Parse(test.url) assert.NoError(t, err) - parser, filename, err := NewHTTP(parse) + parser, filename, err := NewHTTP(context.TODO(), parse) test.assert(parser, filename, err) }) }