mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-07-30 03:30:51 -04:00
60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- v*
|
|
- dev*
|
|
paths:
|
|
- "**/*.go"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
- ".github/workflows/test.yml"
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
paths:
|
|
- "**/*.go"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
- ".github/workflows/test.yml"
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
steps:
|
|
- name: Checkout codebase
|
|
uses: actions/checkout@v7
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: ./go.mod
|
|
cache-dependency-path: ./go.sum
|
|
|
|
- name: Check Go modules
|
|
run: |
|
|
go mod tidy
|
|
git diff --exit-code go.mod go.sum
|
|
go mod verify
|
|
|
|
- name: Run tests with coverage report
|
|
run: |
|
|
go test ./... -v -timeout=1h -coverprofile=coverage.out -covermode=atomic
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v7
|
|
if: runner.os == 'Linux' && env.CODECOV_TOKEN != ''
|
|
with:
|
|
slug: ${{ github.repository }}
|
|
verbose: true
|
|
fail_ci_if_error: true
|