mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 15:36:41 -05:00
Merge pull request #145 from Loyalsoldier/refine-workflow
Refine workflow
This commit is contained in:
commit
8323564e9a
12
.github/workflows/coverage.yml
vendored
12
.github/workflows/coverage.yml
vendored
@ -15,10 +15,20 @@ jobs:
|
||||
with:
|
||||
go-version: ^1.14
|
||||
|
||||
- name: Checkout default branch
|
||||
- name: Checkout codebase
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache go module
|
||||
uses: actions/cache@v2
|
||||
id: cache-gomodules
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
|
||||
- name: Get dependencies
|
||||
if: steps.cache-gomodules.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
|
||||
|
46
.github/workflows/linter.yml
vendored
46
.github/workflows/linter.yml
vendored
@ -11,13 +11,49 @@ jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout default branch
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ^1.14
|
||||
|
||||
- name: Checkout codebase
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Lint Code Base
|
||||
- name: Cache go module
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: ${{ runner.os }}-go-
|
||||
|
||||
- name: Show if need to format code
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
filesNeedToFormat=$(go fmt ./...)
|
||||
if [[ $filesNeedToFormat ]]; then
|
||||
echo -e "\033[0;36m[Error] The following Go files need to be formatted:\033[0m"
|
||||
echo -e "\033[0;31m$filesNeedToFormat\033[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Lint *.go files
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
go vet $(go list ./... | grep -v /external/)
|
||||
if [[ $? != 0 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Lint other files
|
||||
if: ${{ always() }}
|
||||
uses: github/super-linter@v3.8.3
|
||||
env:
|
||||
VALIDATE_ALL_CODEBASE: false
|
||||
VALIDATE_JSON: false
|
||||
VALIDATE_ANSIBLE: false
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
VALIDATE_ALL_CODEBASE: false
|
||||
VALIDATE_BASH: false
|
||||
VALIDATE_DOCKERFILE: false
|
||||
VALIDATE_DOCKERFILE_HADOLINT: false
|
||||
VALIDATE_GO: false
|
||||
VALIDATE_JSON: false
|
||||
VALIDATE_MD: false
|
||||
VALIDATE_PROTOBUF: false
|
||||
|
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@ -7,6 +7,7 @@ on:
|
||||
- "**/*.go"
|
||||
pull_request:
|
||||
branches: [master]
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- "**/*.go"
|
||||
|
||||
@ -22,12 +23,15 @@ jobs:
|
||||
with:
|
||||
go-version: ^1.14
|
||||
|
||||
- name: Checkout default branch
|
||||
- name: Checkout codebase
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get dependencies
|
||||
run: |
|
||||
go get -v -t -d ./...
|
||||
- name: Cache go module
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: ${{ runner.os }}-go-
|
||||
|
||||
- name: Test
|
||||
run: go test -parallel 1 -timeout 6h -v ./...
|
||||
run: go test -timeout 1h -v ./...
|
||||
|
2
.github/workflows/updateGeofile.yml
vendored
2
.github/workflows/updateGeofile.yml
vendored
@ -8,7 +8,7 @@ jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout default branch
|
||||
- name: Checkout codebase
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Download
|
||||
|
Loading…
Reference in New Issue
Block a user