Xray-core/.github/workflows/test.yml

48 lines
1.1 KiB
YAML
Raw Normal View History

name: Test
on:
push:
branches:
- main
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/*.yml"
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**/*.go"
- "go.mod"
- "go.sum"
- ".github/workflows/*.yml"
jobs:
test:
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: Checkout codebase
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
2024-08-26 02:30:38 +00:00
go-version: '1.23'
2022-02-21 14:13:35 +00:00
check-latest: true
2023-02-25 02:26:28 +00:00
- name: Restore Cache
uses: actions/cache/restore@v4
with:
2023-02-25 02:26:28 +00:00
path: resources
key: xray-geodat-
enableCrossOsArchive: true
2024-11-09 18:21:32 +00:00
- name: Format
if: matrix.os == 'ubuntu-latest'
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then echo "::error ::Please run 'gofmt -w .' on the project root" && exit 1; fi
- name: Test
run: go test -timeout 1h -v ./...