github.com/go-email-validator/go-email-validator@v0.0.0-20230409163946-b8b9e6a0552e/.github/workflows/test.yaml (about) 1 on: 2 push: 3 branches: 4 - master 5 pull_request: 6 branches: 7 - master 8 name: Test 9 env: 10 GO_TARGET_VERSION: 1.17.x 11 OS_CODE_COVERAGE: ubuntu-latest 12 jobs: 13 test: 14 strategy: 15 matrix: 16 go-version: 17 - 1.15.x 18 - 1.16.x 19 - 1.17.x 20 os: 21 - ubuntu-latest 22 # - macos-latest 23 # - windows-latest 24 runs-on: ${{ matrix.os }} 25 steps: 26 - name: Install Go 27 uses: actions/setup-go@v2 28 with: 29 go-version: ${{ matrix.go-version }} 30 - name: Checkout code 31 uses: actions/checkout@v2 32 - uses: actions/cache@v2 33 with: 34 path: | 35 ~/go/pkg/mod # Module download cache 36 ~/.cache/go-build # Build cache (Linux) 37 ~/Library/Caches/go-build # Build cache (Mac) 38 '%LocalAppData%\go-build' # Build cache (Windows) 39 key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} 40 restore-keys: | 41 ${{ runner.os }}-go- 42 - name: socks5 43 run: docker run --name proxy -dit --rm -p 1080:1080 -e 'SSS_USERNAME=username' -e 'SSS_PASSWORD=password' dijedodol/simple-socks5-server || sleep 2.5 44 - name: Full test 45 run: make go.test 46 env: 47 PROXIES: "socks5://username:password@127.0.0.1:1080" 48 - name: socks5 stop 49 if: ${{ always() }} 50 run: docker stop proxy 51 - name: Upload coverage to Codecov 52 env: 53 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} 54 if: ${{ env.CODECOV_TOKEN != null }} && ${{ matrix.os == env.OS_CODE_COVERAGE }} && ${{ matrix.go-version == env.GO_TARGET_VERSION }} 55 uses: codecov/codecov-action@v2 56 with: 57 token: ${{ secrets.CODECOV_TOKEN }} 58 file: ./coverage.out 59 fail_ci_if_error: true 60 path_to_write_report: ./codecov_report.txt 61 verbose: true