github.com/dolthub/swiss@v0.2.2-0.20240312182618-f4b2babd2bc1/.github/workflows/ci-go-tests.yaml (about) 1 name: Test 2 on: 3 pull_request: 4 branches: [ main ] 5 workflow_dispatch: 6 7 concurrency: 8 group: test-${{ github.event.pull_request.number || github.ref }} 9 cancel-in-progress: false 10 11 jobs: 12 test: 13 strategy: 14 matrix: 15 go-version: [1.18.x, 1.19.x, 1.20.x] 16 platform: [ubuntu-latest, macos-latest, windows-latest] 17 runs-on: ${{ matrix.platform }} 18 steps: 19 - name: Install Go 20 uses: actions/setup-go@v3 21 with: 22 go-version: ${{ matrix.go-version }} 23 - name: Checkout code 24 uses: actions/checkout@v3 25 - name: Go Unittest (SIMD) 26 run: go test ./... 27 - name: Go Unittest (non-SIMD) 28 run: go test -tags="nosimd" ./... 29 fuzz: 30 strategy: 31 matrix: 32 go-version: [1.18.x, 1.19.x, 1.20.x] 33 platform: [ubuntu-latest] 34 tags: [ "", "nosimd"] 35 runs-on: ${{ matrix.platform }} 36 steps: 37 - name: Install Go 38 uses: actions/setup-go@v3 39 with: 40 go-version: ${{ matrix.go-version }} 41 - name: Checkout code 42 uses: actions/checkout@v3 43 - name: Fuzz Test All 44 working-directory: . 45 run: | 46 files=$(grep -r --include='**_test.go' --files-with-matches 'func Fuzz' .) 47 for file in ${files} 48 do 49 funcs=$(grep -oP 'func \K(Fuzz\w*)' $file) 50 tag=${{ matrix.tags }} 51 for func in ${funcs} 52 do 53 echo "Fuzzing $func in $file" 54 parentDir=$(dirname $file) 55 go test $parentDir -tags=$tag -run=$func -fuzz=$func -fuzztime=5s 56 done 57 done