github.com/ncruces/go-sqlite3@v0.15.1-0.20240520133447-53eef1510ff0/.github/workflows/test.yml (about) 1 name: Test 2 3 on: 4 push: 5 branches: [ "main" ] 6 pull_request: 7 branches: [ "main" ] 8 workflow_dispatch: 9 10 jobs: 11 test: 12 strategy: 13 matrix: 14 os: [macos-latest, ubuntu-latest, windows-latest] 15 runs-on: ${{ matrix.os }} 16 17 steps: 18 - uses: actions/checkout@v4 19 - uses: actions/setup-go@v5 20 with: { go-version: stable } 21 22 - name: Git LFS pull 23 uses: ./.github/actions/lfs 24 25 - name: Format 26 run: gofmt -s -w . && git diff --exit-code 27 if: matrix.os != 'windows-latest' 28 29 - name: Tidy 30 run: go mod tidy && git diff --exit-code 31 32 - name: Download 33 run: go mod download 34 35 - name: Verify 36 run: go mod verify 37 38 - name: Vet 39 run: go vet ./... 40 41 - name: Build 42 run: go build -v ./... 43 44 - name: Test 45 run: go test -v ./... -bench . -benchtime=1x 46 47 - name: Test BSD locks 48 run: go test -v -tags sqlite3_flock ./... 49 if: matrix.os == 'macos-latest' 50 51 - name: Test no shared memory 52 run: go test -v -tags sqlite3_noshm ./... 53 if: matrix.os == 'ubuntu-latest' 54 55 - name: Test no locks 56 run: go test -v -tags sqlite3_nosys ./... 57 if: matrix.os == 'ubuntu-latest' 58 59 - name: Test GORM 60 run: gormlite/test.sh 61 62 - uses: ncruces/go-coverage-report@v0 63 with: 64 chart: true 65 amend: true 66 if: | 67 github.event_name == 'push' && 68 matrix.os == 'ubuntu-latest' 69 70 test-intel: 71 runs-on: macos-13 72 needs: test 73 74 steps: 75 - uses: actions/checkout@v4 76 - uses: actions/setup-go@v5 77 with: { go-version: stable } 78 79 - name: Git LFS pull 80 uses: ./.github/actions/lfs 81 82 - name: Test 83 run: go test -v ./... 84 85 test-bsd: 86 runs-on: ubuntu-latest 87 needs: test 88 89 steps: 90 - uses: actions/checkout@v4 91 - uses: actions/setup-go@v5 92 with: { go-version: stable } 93 94 - name: Git LFS pull 95 uses: ./.github/actions/lfs 96 97 - name: Build 98 env: 99 GOOS: freebsd 100 TESTFLAGS: '-test.v' 101 run: .github/workflows/build-test.sh 102 103 - name: Test 104 uses: cross-platform-actions/action@v0.24.0 105 with: 106 operating_system: freebsd 107 version: '14.0' 108 shell: bash 109 run: . ./test.sh 110 sync_files: runner-to-vm 111 112 test-qemu: 113 runs-on: ubuntu-latest 114 needs: test 115 116 steps: 117 - uses: docker/setup-qemu-action@v3 118 - uses: actions/checkout@v4 119 - uses: actions/setup-go@v5 120 with: { go-version: stable } 121 122 - name: Git LFS pull 123 uses: ./.github/actions/lfs 124 125 - name: Test 386 (32-bit) 126 run: GOARCH=386 go test -v -short ./... 127 128 - name: Test arm64 (compiler) 129 run: GOARCH=arm64 go test -v -short ./... 130 131 - name: Test riscv64 (interpreter) 132 run: GOARCH=riscv64 go test -v -short ./... 133 134 - name: Test s390x (big-endian, z/OS) 135 run: GOARCH=s390x go test -v -short -tags sqlite3_flock ./... 136 137 test-vm: 138 runs-on: ubuntu-latest 139 needs: test 140 141 steps: 142 - uses: actions/checkout@v4 143 - uses: actions/setup-go@v5 144 with: { go-version: stable } 145 146 - name: Git LFS pull 147 uses: ./.github/actions/lfs 148 149 - name: Build illumos 150 env: 151 GOOS: illumos 152 TESTFLAGS: '-test.v -test.short' 153 run: .github/workflows/build-test.sh 154 155 - name: Test illumos 156 uses: vmactions/omnios-vm@v1 157 with: 158 usesh: true 159 copyback: false 160 run: . ./test.sh 161 162 - name: Build Solaris 163 env: 164 GOOS: solaris 165 TESTFLAGS: '-test.v -test.short' 166 run: .github/workflows/build-test.sh 167 168 - name: Test Solaris 169 uses: vmactions/solaris-vm@v1 170 with: 171 usesh: true 172 copyback: false 173 run: . ./test.sh 174 continue-on-error: true