From 9e07d8304d6e4df6a299a7c4095d92ca161a5cea Mon Sep 17 00:00:00 2001 From: yuhan6665 <1588741+yuhan6665@users.noreply.github.com> Date: Tue, 21 Feb 2023 22:23:10 -0500 Subject: [PATCH] Add retry for test steps to download geofiles --- .github/workflows/test.yml | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffdc64cb..03a2a37e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,15 +37,25 @@ jobs: - name: Prepare geo*dat if: ${{ matrix.os != 'windows-latest' }} - run: | - mkdir resources - wget -O ./resources/geoip.dat https://github.com/v2fly/geoip/releases/latest/download/geoip.dat - wget -O ./resources/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat + 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 + wget -O ./resources/geosite.dat https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat - name: Prepare geo*dat for Windows if: ${{ matrix.os == 'windows-latest' }} - run: | - mkdir resources - Invoke-WebRequest -Uri "https://github.com/v2fly/geoip/releases/latest/download/geoip.dat" -OutFile "./resources/geoip.dat" - Invoke-WebRequest -Uri "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat" -OutFile "./resources/geosite.dat" + 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" + 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 ./...