ci: add github action workflows (#2596)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* ci: add github action workflows * test: fixed the TestUnixSocket test on windows (#20) * ci: add github action workflows (#18) * Remove .travis.yml * ci: replace GITTER_ROOM_ID and upload coverage every time you go test * ci: update coverage using codecov/codecov-action@v1 * Merge branch 'master' into github-actions * repo: replace travis ci to github actions * ci: add go version 1.16 * fix: go install requires a specific version * chore(ci): remove go 1.12 support * chore(ci): remove os windows-latest
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: thinkerou <thinkerou@gmail.com>
- Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Diff stats
6 files+73 added−57 removed
- other:+73 added−57 removed
Provenance
- Commit
fb8a113- Tree
ec25726- Author
Jeff <laojianzi1994@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
a8857ed
6 files changed+73 added−57 removed
added:.github/workflows/gin.yml+62 added
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162name: Run Tests
on: push: branches: - master pull_request: branches: - master
jobs: test: strategy: matrix: os: [ubuntu-latest, macos-latest] go: [1.13, 1.14, 1.15, 1.16] test-tags: ['', nomsgpack] name: ${{ matrix.os }} @ Go ${{ matrix.go }} ${{ matrix.test-tags }} runs-on: ${{ matrix.os }} env: GO111MODULE: on TESTTAGS: ${{ matrix.test-tags }} GOPROXY: https://proxy.golang.org steps: - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v2 with: go-version: ${{ matrix.go }}
- name: Checkout Code uses: actions/checkout@v2 with: ref: ${{ github.ref }}
- name: Install Dependencies run: make tools
- name: Run Check run: | make vet make fmt-check make misspell-check
- name: Run Tests run: make test
- name: Upload coverage to Codecov uses: codecov/codecov-action@v1 notification-gitter: needs: test runs-on: ubuntu-latest steps: - name: Notification failure message if: failure() run: | PR_OR_COMPARE="$(if [ "${{ github.event.pull_request }}" != "" ]; then echo "${{ github.event.pull_request.html_url }}"; else echo "${{ github.event.compare }}"; fi)" curl -d message="GitHub Actions [$GITHUB_REPOSITORY]($PR_OR_COMPARE) ($GITHUB_REF) [normal]($GITHUB_API_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) ($GITHUB_RUN_NUMBER)" -d level=error https://webhooks.gitter.im/e/7f95bf605c4d356372f4 - name: Notification success message if: success() run: | PR_OR_COMPARE="$(if [ "${{ github.event.pull_request }}" != "" ]; then echo "${{ github.event.pull_request.html_url }}"; else echo "${{ github.event.compare }}"; fi)" curl -d message="GitHub Actions [$GITHUB_REPOSITORY]($PR_OR_COMPARE) ($GITHUB_REF) [normal]($GITHUB_API_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID) ($GITHUB_RUN_NUMBER)" https://webhooks.gitter.im/e/7f95bf605c4d356372f4modified:.github/PULL_REQUEST_TEMPLATE.md+1 added-1 removed
12344567- With pull requests: - Open your pull request against `master` - Your pull request should have no more than two commits, if not you should squash them. - It should pass all tests in the available continuous integration systems such as TravisCI. - It should pass all tests in the available continuous integration systems such as GitHub Actions. - You should add/modify tests to cover your proposed code changes. - If your pull request contains a new feature, please document it on the README.
deleted:.travis.yml-52 removed
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152language: go
matrix: fast_finish: true include: - go: 1.13.x - go: 1.13.x env: - TESTTAGS=nomsgpack - go: 1.14.x - go: 1.14.x env: - TESTTAGS=nomsgpack - go: 1.15.x - go: 1.15.x env: - TESTTAGS=nomsgpack - go: 1.16.x - go: 1.16.x env: - TESTTAGS=nomsgpack - go: master
git: depth: 10
before_install: - if [[ "${GO111MODULE}" = "on" ]]; then mkdir "${HOME}/go"; export GOPATH="${HOME}/go"; fi
install: - if [[ "${GO111MODULE}" = "on" ]]; then go mod download; fi - if [[ "${GO111MODULE}" = "on" ]]; then export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"; fi - if [[ "${GO111MODULE}" = "on" ]]; then make tools; fi
go_import_path: github.com/gin-gonic/gin
script: - make vet - make fmt-check - make misspell-check - make test
after_success: - bash <(curl -s https://codecov.io/bash)
notifications: webhooks: urls: - https://webhooks.gitter.im/e/7f95bf605c4d356372f4 on_success: change # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always on_start: false # default: falsemodified:CONTRIBUTING.md+1 added-1 removed
6 unmodified lines78910111112136 unmodified lines
- With pull requests: - Open your pull request against `master` - Your pull request should have no more than two commits, if not you should squash them. - It should pass all tests in the available continuous integration systems such as TravisCI. - It should pass all tests in the available continuous integration systems such as GitHub Actions. - You should add/modify tests to cover your proposed code changes. - If your pull request contains a new feature, please document it on the README.modified:Makefile+8 added-2 removed
1 GO ?= go2 GOFMT ?= gofmt "-s"3+GO_VERSION=$(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)4 PACKAGES ?= $(shell $(GO) list ./...)5 VETPACKAGES ?= $(shell $(GO) list ./... | grep -v /examples/)6 GOFILES := $(shell find . -name "*.go")7 TESTFOLDER := $(shell $(GO) list ./... | grep -E 'gin$$|binding$$|render$$' | grep -v examples)59 unmodified lines67 misspell -w $(GOFILES)68 69 .PHONY: tools70 tools:70- go install golang.org/x/lint/golint; \71- go install github.com/client9/misspell/cmd/misspell;71+ @if [ $(GO_VERSION) -gt 15 ]; then \72+ $(GO) install golang.org/x/lint/golint@latest; \73+ $(GO) install github.com/client9/misspell/cmd/misspell@latest; \74+ elif [ $(GO_VERSION) -lt 16 ]; then \75+ $(GO) install golang.org/x/lint/golint; \76+ $(GO) install github.com/client9/misspell/cmd/misspell; \77+ fimodified:README.md+1 added-1 removed
1 # Gin Web Framework2 3 <img align="right" width="159px" src="https://raw.githubusercontent.com/gin-gonic/logo/master/color.png">4 5-[](https://travis-ci.org/gin-gonic/gin)5+[](https://github.com/gin-gonic/gin/actions?query=branch%3Amaster)6 [](https://codecov.io/gh/gin-gonic/gin)7 [](https://goreportcard.com/report/github.com/gin-gonic/gin)8 [](https://pkg.go.dev/github.com/gin-gonic/gin?tab=doc)9 [](https://gitter.im/gin-gonic/gin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)2225 unmodified lines