github.com/xraypb/xray-core@v1.6.6/.github/workflows/test.yml (about) 1 name: Test 2 3 on: 4 push: 5 branches: 6 - main 7 paths: 8 - "**/*.go" 9 - "go.mod" 10 - "go.sum" 11 - ".github/workflows/*.yml" 12 pull_request: 13 types: [opened, synchronize, reopened] 14 paths: 15 - "**/*.go" 16 - "go.mod" 17 - "go.sum" 18 - ".github/workflows/*.yml" 19 20 jobs: 21 test: 22 permissions: 23 contents: read 24 runs-on: ${{ matrix.os }} 25 strategy: 26 fail-fast: false 27 matrix: 28 os: [windows-latest, ubuntu-latest, macos-latest] 29 steps: 30 - name: Set up Go 31 uses: actions/setup-go@v3 32 with: 33 go-version: 1.19 34 check-latest: true 35 - name: Checkout codebase 36 uses: actions/checkout@v3 37 38 - name: Prepare geo*dat 39 if: ${{ matrix.os != 'windows-latest' }} 40 run: | 41 mkdir resources 42 wget -O ./resources/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat 43 wget -O ./resources/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat 44 - name: Prepare geo*dat for Windows 45 if: ${{ matrix.os == 'windows-latest' }} 46 run: | 47 mkdir resources 48 Invoke-WebRequest -Uri "https://github.com/v2fly/geoip/releases/latest/download/geoip.dat" -OutFile "./resources/geoip.dat" 49 Invoke-WebRequest -Uri "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat" -OutFile "./resources/geosite.dat" 50 - name: Test 51 run: go test -timeout 1h -v ./...