|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: {} |
| 5 | + |
| 6 | +jobs: |
| 7 | + Unit-Tests: |
| 8 | + name: unit-tests |
| 9 | + runs-on: depot-ubuntu-24.04 |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v4 |
| 12 | + - name: Set up Go |
| 13 | + uses: actions/setup-go@v5 |
| 14 | + with: |
| 15 | + go-version: "1.22" |
| 16 | + cache: true |
| 17 | + - name: Unit test |
| 18 | + run: ./test/run.sh --unit-only |
| 19 | + - name: Archive code coverage results |
| 20 | + uses: actions/upload-artifact@v4 |
| 21 | + with: |
| 22 | + name: coverage-report-unit |
| 23 | + path: coverage-unit.txt |
| 24 | + |
| 25 | + Integration-Tests: |
| 26 | + name: integration-tests |
| 27 | + runs-on: depot-ubuntu-24.04 |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - name: Set up Go |
| 31 | + uses: actions/setup-go@v5 |
| 32 | + with: |
| 33 | + go-version: "1.22" |
| 34 | + cache: true |
| 35 | + - name: Integration test |
| 36 | + run: ./test/run.sh --integration-only |
| 37 | + - name: Archive code coverage results |
| 38 | + uses: actions/upload-artifact@v4 |
| 39 | + with: |
| 40 | + name: coverage-report-integration |
| 41 | + path: coverage-integration.txt |
| 42 | + |
| 43 | + Modules-Acceptance-Tests: |
| 44 | + name: modules-acceptance-tests |
| 45 | + runs-on: depot-ubuntu-24.04 |
| 46 | + strategy: |
| 47 | + fail-fast: false |
| 48 | + matrix: |
| 49 | + test: |
| 50 | + [ |
| 51 | + "--only-module-backup-azure", |
| 52 | + "--only-module-backup-filesystem", |
| 53 | + "--only-module-backup-gcs", |
| 54 | + "--only-module-backup-s3", |
| 55 | + "--only-module-offload-s3", |
| 56 | + "--only-module-img2vec-neural", |
| 57 | + "--only-module-many-modules", |
| 58 | + "--only-module-many-generative", |
| 59 | + "--only-module-ref2vec-centroid", |
| 60 | + "--only-module-text2vec-contextionary", |
| 61 | + "--only-module-text2vec-transformers", |
| 62 | + "--only-module-text2vec-ollama", |
| 63 | + "--only-module-generative-ollama", |
| 64 | + "--only-module-many-generative", |
| 65 | + ] |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v4 |
| 68 | + - name: Set up Go |
| 69 | + uses: actions/setup-go@v5 |
| 70 | + with: |
| 71 | + go-version: "1.22" |
| 72 | + cache: true |
| 73 | + - name: Acceptance tests (modules) |
| 74 | + uses: nick-fields/retry@v3 |
| 75 | + with: |
| 76 | + # 15 Minute is a large enough timeout for most of our tests |
| 77 | + timeout_minutes: 15 |
| 78 | + max_attempts: 3 |
| 79 | + command: ./test/run.sh ${{ matrix.test }} |
| 80 | + on_retry_command: ./test/run.sh --cleanup |
| 81 | + |
| 82 | + # Modules-Acceptance-Tests-large: |
| 83 | + # name: modules-acceptance-tests-large |
| 84 | + # runs-on: depot-ubuntu-24.04-4 |
| 85 | + # strategy: |
| 86 | + # fail-fast: false |
| 87 | + # matrix: |
| 88 | + # test: |
| 89 | + # [ |
| 90 | + # "--only-module-qna-transformers", |
| 91 | + # "--only-module-sum-transformers", |
| 92 | + # "--only-module-multi2vec-clip", |
| 93 | + # "--only-module-reranker-transformers", |
| 94 | + # ] |
| 95 | + # steps: |
| 96 | + # - uses: actions/checkout@v4 |
| 97 | + # - name: Set up Go |
| 98 | + # uses: actions/setup-go@v5 |
| 99 | + # with: |
| 100 | + # go-version: "1.22" |
| 101 | + # cache: true |
| 102 | + # - name: Acceptance tests Large (modules) |
| 103 | + # uses: nick-fields/retry@v3 |
| 104 | + # with: |
| 105 | + # # 15 Minute is a large enough timeout for most of our tests |
| 106 | + # timeout_minutes: 15 |
| 107 | + # max_attempts: 3 |
| 108 | + # command: ./test/run.sh ${{ matrix.test }} |
| 109 | + # on_retry_command: ./test/run.sh --cleanup |
| 110 | + |
| 111 | + # Modules-Acceptance-Tests-api: |
| 112 | + # name: modules-acceptance-tests-api |
| 113 | + # runs-on: depot-ubuntu-24.04 |
| 114 | + # strategy: |
| 115 | + # fail-fast: false |
| 116 | + # matrix: |
| 117 | + # test: |
| 118 | + # [ |
| 119 | + # "--only-module-multi2vec-cohere", |
| 120 | + # "--only-module-multi2vec-google", |
| 121 | + # "--only-module-generative-aws", |
| 122 | + # "--only-module-generative-cohere", |
| 123 | + # "--only-module-generative-google", |
| 124 | + # "--only-module-generative-openai", |
| 125 | + # "--only-module-text2vec-google", |
| 126 | + # "--only-module-text2vec-aws", |
| 127 | + # "--only-module-text2vec-jinaai", |
| 128 | + # "--only-module-multi2vec-jinaai", |
| 129 | + # "--only-module-text2colbert-jinaai", |
| 130 | + # ] |
| 131 | + # steps: |
| 132 | + # - uses: actions/checkout@v4 |
| 133 | + # with: |
| 134 | + # fetch-depth: 2 |
| 135 | + # - name: Set up Go |
| 136 | + # uses: actions/setup-go@v5 |
| 137 | + # with: |
| 138 | + # go-version: "1.22" |
| 139 | + # cache: true |
| 140 | + # - name: check |
| 141 | + # env: |
| 142 | + # COMMIT_SHA: ${{ github.event.pull_request.head.sha }} |
| 143 | + # run: | |
| 144 | + # commit_message=$(git log -1 --format=%B $COMMIT_SHA) |
| 145 | + # if [[ "$commit_message" == *"[api]"* || "$commit_message" == "prepare release"* ]]; then |
| 146 | + # echo "Run pipeline" |
| 147 | + # echo "run_pipeline=true" >> $GITHUB_ENV |
| 148 | + # else |
| 149 | + # echo "Skip pipeline. In order to run the pipeline commit title must contain: [api]" |
| 150 | + # echo "run_pipeline=false" >> $GITHUB_ENV |
| 151 | + # fi |
| 152 | + # - name: configure gcp |
| 153 | + # if: ${{ env.run_pipeline == 'true' || startsWith(github.ref, 'refs/tags') }} |
| 154 | + # id: creds-gcp |
| 155 | + # env: |
| 156 | + # GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} |
| 157 | + # GCP_PROJECT: ${{ secrets.GCP_PROJECT }} |
| 158 | + # run: | |
| 159 | + # ./tools/ci/gcloud.sh |
| 160 | + # google_apikey=$(gcloud auth print-access-token) |
| 161 | + # echo "::add-mask::$google_apikey" |
| 162 | + # echo "google_apikey=$google_apikey" >> "$GITHUB_OUTPUT" |
| 163 | + # - name: configure aws |
| 164 | + # if: ${{ env.run_pipeline == 'true' || startsWith(github.ref, 'refs/tags') }} |
| 165 | + # id: creds-aws |
| 166 | + # uses: aws-actions/configure-aws-credentials@v4 |
| 167 | + # with: |
| 168 | + # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 169 | + # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 170 | + # aws-region: ${{ secrets.AWS_REGION }} |
| 171 | + # role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} |
| 172 | + # role-external-id: ${{ secrets.AWS_ROLE_EXTERNAL_ID }} |
| 173 | + # role-skip-session-tagging: true |
| 174 | + # output-credentials: true |
| 175 | + # - name: Acceptance tests (modules) |
| 176 | + # if: ${{ env.run_pipeline == 'true' || startsWith(github.ref, 'refs/tags') }} |
| 177 | + # env: |
| 178 | + # GCP_PROJECT: ${{ secrets.GCP_PROJECT }} |
| 179 | + # GOOGLE_APIKEY: ${{ steps.creds-gcp.outputs.google_apikey }} |
| 180 | + # AWS_REGION: ${{ secrets.AWS_REGION }} |
| 181 | + # AWS_ACCESS_KEY_ID: ${{ steps.creds-aws.outputs.aws-access-key-id }} |
| 182 | + # AWS_SECRET_ACCESS_KEY: ${{ steps.creds-aws.outputs.aws-secret-access-key }} |
| 183 | + # AWS_SESSION_TOKEN: ${{ steps.creds-aws.outputs.aws-session-token }} |
| 184 | + # OPENAI_APIKEY: ${{ secrets.OPENAI_APIKEY }} |
| 185 | + # OPENAI_ORGANIZATION: ${{ secrets.OPENAI_ORGANIZATION }} |
| 186 | + # COHERE_APIKEY: ${{ secrets.COHERE_APIKEY }} |
| 187 | + # ANTHROPIC_APIKEY: ${{ secrets.ANTHROPIC_APIKEY }} |
| 188 | + # JINAAI_APIKEY: ${{ secrets.JINAAI_APIKEY }} |
| 189 | + # run: ./test/run.sh ${{ matrix.test }} |
| 190 | + |
| 191 | + Acceptance-Tests: |
| 192 | + name: acceptance-tests |
| 193 | + runs-on: depot-ubuntu-24.04 |
| 194 | + strategy: |
| 195 | + fail-fast: false |
| 196 | + matrix: |
| 197 | + test: |
| 198 | + [ |
| 199 | + "--acceptance-only-fast", |
| 200 | + "--acceptance-only-graphql", |
| 201 | + "--acceptance-only-authz", |
| 202 | + "--acceptance-only-replication", |
| 203 | + "--acceptance-only-async-replication", |
| 204 | + "--acceptance-go-client-only-fast", |
| 205 | + "--acceptance-only-python", |
| 206 | + ] |
| 207 | + steps: |
| 208 | + - uses: actions/checkout@v4 |
| 209 | + - name: Set up Go |
| 210 | + uses: actions/setup-go@v5 |
| 211 | + with: |
| 212 | + go-version: "1.22" |
| 213 | + cache: true |
| 214 | + - name: Acceptance tests |
| 215 | + env: |
| 216 | + WCS_DUMMY_CI_PW: ${{ secrets.WCS_DUMMY_CI_PW || 'pw1' }} |
| 217 | + WCS_DUMMY_CI_PW_2: ${{ secrets.WCS_DUMMY_CI_PW_2 || 'pw2' }} |
| 218 | + run: ./test/run.sh ${{ matrix.test }} |
| 219 | + |
| 220 | + Acceptance-Tests-large: |
| 221 | + name: acceptance-tests-large |
| 222 | + runs-on: depot-ubuntu-24.04-4 |
| 223 | + strategy: |
| 224 | + fail-fast: false |
| 225 | + matrix: |
| 226 | + test: |
| 227 | + [ |
| 228 | + "--acceptance-go-client-named-vectors-single-node", |
| 229 | + "--acceptance-go-client-named-vectors-cluster", |
| 230 | + "--acceptance-lsmkv", |
| 231 | + ] |
| 232 | + steps: |
| 233 | + - uses: actions/checkout@v4 |
| 234 | + - name: Set up Go |
| 235 | + uses: actions/setup-go@v5 |
| 236 | + with: |
| 237 | + go-version: "1.22" |
| 238 | + cache: true |
| 239 | + - name: Determine retry max_attempts value |
| 240 | + env: |
| 241 | + MATRIX_TEST: ${{ matrix.test }} |
| 242 | + run: | |
| 243 | + if [[ "$MATRIX_TEST" == *"lsmkv"* ]]; then |
| 244 | + echo "retry_max_attempts=2" >> $GITHUB_ENV |
| 245 | + else |
| 246 | + echo "retry_max_attempts=1" >> $GITHUB_ENV |
| 247 | + fi |
| 248 | + - name: Acceptance tests Large |
| 249 | + uses: nick-fields/retry@v3 |
| 250 | + with: |
| 251 | + # 15 Minute is a large enough timeout for most of our tests |
| 252 | + timeout_minutes: 15 |
| 253 | + max_attempts: ${{ env.retry_max_attempts }} |
| 254 | + command: ./test/run.sh ${{ matrix.test }} |
| 255 | + on_retry_command: ./test/run.sh --cleanup |
| 256 | + |
| 257 | + Compile-and-upload-binaries: |
| 258 | + name: compile-and-upload-binaries |
| 259 | + runs-on: depot-ubuntu-24.04-4 |
| 260 | + steps: |
| 261 | + - uses: actions/checkout@v4 |
| 262 | + - name: Set up Go |
| 263 | + uses: actions/setup-go@v5 |
| 264 | + with: |
| 265 | + go-version: "1.22" |
| 266 | + cache: true |
| 267 | + - name: Install GoReleaser |
| 268 | + uses: goreleaser/goreleaser-action@v6 |
| 269 | + with: |
| 270 | + install-only: true |
| 271 | + - name: goreleaser |
| 272 | + run: | |
| 273 | + GIT_REVISION=$(git rev-parse --short HEAD) GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) BUILD_USER=ci BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") goreleaser build --clean --snapshot |
| 274 | + - name: Upload macos |
| 275 | + uses: actions/upload-artifact@v4 |
| 276 | + with: |
| 277 | + name: binaries-macos-unsigned |
| 278 | + path: dist/weaviate_darwin_all |
| 279 | + - name: Upload windows |
| 280 | + uses: actions/upload-artifact@v4 |
| 281 | + with: |
| 282 | + name: binaries-windows-amd64 |
| 283 | + path: dist/weaviate_windows_amd64_v1 |
| 284 | + - name: Upload windows |
| 285 | + uses: actions/upload-artifact@v4 |
| 286 | + with: |
| 287 | + name: binaries-windows-arm64 |
| 288 | + path: dist/weaviate_windows_arm64 |
| 289 | + - name: Upload linux amd64 |
| 290 | + uses: actions/upload-artifact@v4 |
| 291 | + with: |
| 292 | + name: binaries-linux-amd64 |
| 293 | + path: dist/weaviate_linux_amd64_v1 |
| 294 | + - name: Upload linux arm64 |
| 295 | + uses: actions/upload-artifact@v4 |
| 296 | + with: |
| 297 | + name: binaries-linux-arm64 |
| 298 | + path: dist/weaviate_linux_arm64 |
| 299 | + |
| 300 | + # Acceptance-Tests-windows: |
| 301 | + # name: acceptance-tests-windows |
| 302 | + # needs: Compile-and-upload-binaries |
| 303 | + # runs-on: windows-latest |
| 304 | + # env: |
| 305 | + # AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: true |
| 306 | + # PERSISTENCE_DATA_PATH: /tmp |
| 307 | + # QUERY_DEFAULTS_LIMIT: 20 |
| 308 | + # CLUSTER_HOSTNAME: node1 |
| 309 | + # RAFT_BOOTSTRAP_EXPECT: 1 |
| 310 | + # RAFT_JOIN: node1 |
| 311 | + # GRPC_PORT: 50052 |
| 312 | + # steps: |
| 313 | + # - uses: actions/checkout@v4 |
| 314 | + # - name: Download binaries |
| 315 | + # uses: actions/download-artifact@v4 |
| 316 | + # with: |
| 317 | + # name: binaries-windows-amd64 |
| 318 | + # - name: Set up Go |
| 319 | + # uses: actions/setup-go@v5 |
| 320 | + # with: |
| 321 | + # go-version: "1.22" |
| 322 | + # cache: true |
| 323 | + # - name: start weaviate |
| 324 | + # shell: bash |
| 325 | + # # Weaviate is started without a Vectorizer as running text2vec-contextionary on GH actions is difficult: |
| 326 | + # # - docker on GHA only supports windows container - which we currently are not build |
| 327 | + # # - building those containers without a windows machine is difficult to figure out |
| 328 | + # run: ./weaviate.exe --scheme http --port 8080 & |
| 329 | + # - name: run acceptance tests |
| 330 | + # shell: bash |
| 331 | + # run: go test -count 1 -race test/acceptance/actions/*.go # tests that don't need a Vectorizer |
| 332 | + |
| 333 | + # Push-Docker: |
| 334 | + # if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.head_ref, 'build') && github.triggering_actor != 'dependabot[bot]' }} # no PRs from fork |
| 335 | + # needs: [Unit-Tests, Integration-Tests] |
| 336 | + # name: push-docker |
| 337 | + # timeout-minutes: 30 |
| 338 | + # runs-on: depot-ubuntu-24.04-8-cores |
| 339 | + # steps: |
| 340 | + # - uses: actions/checkout@v4 |
| 341 | + # - name: Login to Docker Hub |
| 342 | + # uses: docker/login-action@v3 |
| 343 | + # with: |
| 344 | + # username: ${{secrets.DOCKER_USERNAME}} |
| 345 | + # password: ${{secrets.DOCKER_PASSWORD}} |
| 346 | + # - name: Push container |
| 347 | + # id: push-container |
| 348 | + # run: ./ci/push_docker.sh |
| 349 | + # env: |
| 350 | + # PR_TITLE: "${{ github.event.pull_request.title }}" |
| 351 | + # - name: Generate Report |
| 352 | + # env: |
| 353 | + # PREVIEW_TAG: "${{ steps.push-container.outputs.PREVIEW_TAG }}" |
| 354 | + # PREVIEW_SEMVER_TAG: "${{ steps.push-container.outputs.PREVIEW_SEMVER_TAG }}" |
| 355 | + # run: ./ci/generate_docker_report.sh |
| 356 | + # Push-Docker-Fast: |
| 357 | + # if: ${{ !github.event.pull_request.head.repo.fork && startsWith(github.head_ref, 'build') && github.triggering_actor != 'dependabot[bot]' }} # no PRs from fork |
| 358 | + # name: push-docker-fast |
| 359 | + # timeout-minutes: 30 |
| 360 | + # runs-on: depot-ubuntu-24.04-8-cores |
| 361 | + # steps: |
| 362 | + # - uses: actions/checkout@v4 |
| 363 | + # - name: Login to Docker Hub |
| 364 | + # uses: docker/login-action@v3 |
| 365 | + # with: |
| 366 | + # username: ${{secrets.DOCKER_USERNAME}} |
| 367 | + # password: ${{secrets.DOCKER_PASSWORD}} |
| 368 | + # - name: Push container |
| 369 | + # id: push-container |
| 370 | + # run: ./ci/push_docker.sh |
| 371 | + # env: |
| 372 | + # PR_TITLE: "${{ github.event.pull_request.title }}" |
| 373 | + # - name: Generate Report |
| 374 | + # env: |
| 375 | + # PREVIEW_TAG: "${{ steps.push-container.outputs.PREVIEW_TAG }}" |
| 376 | + # PREVIEW_SEMVER_TAG: "${{ steps.push-container.outputs.PREVIEW_SEMVER_TAG }}" |
| 377 | + # run: ./ci/generate_docker_report.sh |
0 commit comments