2020-06-19 09:19:37 -04:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-11-23 07:51:58 -05:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- v*
|
2020-08-25 02:46:04 -04:00
|
|
|
paths:
|
|
|
|
- "**/*.go"
|
2020-09-09 01:56:17 -04:00
|
|
|
- "go.mod"
|
|
|
|
- "go.sum"
|
2020-06-19 09:19:37 -04:00
|
|
|
pull_request:
|
2020-08-30 13:10:28 -04:00
|
|
|
types: [opened, synchronize, reopened]
|
2020-08-24 12:04:55 -04:00
|
|
|
paths:
|
|
|
|
- "**/*.go"
|
2020-09-09 01:56:17 -04:00
|
|
|
- "go.mod"
|
|
|
|
- "go.sum"
|
2020-06-19 09:19:37 -04:00
|
|
|
|
|
|
|
jobs:
|
2020-08-24 04:09:51 -04:00
|
|
|
test:
|
2020-10-01 21:16:25 -04:00
|
|
|
if: github.repository != 'v2ray/v2ray-core'
|
2020-06-19 09:19:37 -04:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2020-11-15 10:39:23 -05:00
|
|
|
fail-fast: false
|
2020-06-19 09:19:37 -04:00
|
|
|
matrix:
|
|
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
|
|
steps:
|
|
|
|
- name: Set up Go 1.x
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2020-09-09 06:19:49 -04:00
|
|
|
go-version: ^1.15
|
2020-06-19 09:19:37 -04:00
|
|
|
|
2020-08-30 13:10:28 -04:00
|
|
|
- name: Checkout codebase
|
2020-06-19 09:19:37 -04:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-08-30 13:10:28 -04:00
|
|
|
- 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-
|
2020-06-19 09:19:37 -04:00
|
|
|
|
|
|
|
- name: Test
|
2020-08-30 13:10:28 -04:00
|
|
|
run: go test -timeout 1h -v ./...
|