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

78 lines
2.3 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: Set up Go
uses: actions/setup-go@v3
with:
2023-02-02 08:26:07 +02:00
go-version: '1.20'
2022-02-21 16:13:35 +02:00
check-latest: true
- name: Checkout codebase
uses: actions/checkout@v3
- name: Prepare geoip
if: ${{ matrix.os != 'windows-latest' }}
uses: nick-fields/retry@v2
with:
timeout_minutes: 60
retry_wait_seconds: 30
max_attempts: 60
command: |
mkdir resources
wget -O ./resources/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat
- name: Prepare geosite
if: ${{ matrix.os != 'windows-latest' }}
uses: nick-fields/retry@v2
with:
timeout_minutes: 60
retry_wait_seconds: 30
max_attempts: 60
command: |
wget -O ./resources/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat
- name: Prepare geoip for Windows
if: ${{ matrix.os == 'windows-latest' }}
uses: nick-fields/retry@v2
with:
timeout_minutes: 60
retry_wait_seconds: 30
max_attempts: 60
command: |
mkdir resources
Invoke-WebRequest -Uri "https://github.com/v2fly/geoip/releases/latest/download/geoip.dat" -OutFile "./resources/geoip.dat"
- name: Prepare geosite for Windows
if: ${{ matrix.os == 'windows-latest' }}
uses: nick-fields/retry@v2
with:
timeout_minutes: 60
retry_wait_seconds: 30
max_attempts: 60
command: |
Invoke-WebRequest -Uri "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat" -OutFile "./resources/geosite.dat"
- name: Test
run: go test -timeout 1h -v ./...