Skip to content

Commit

Permalink
Compile and upload binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkkul committed Jul 26, 2023
1 parent ec37dbc commit 3c10ab8
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 23 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/pull_requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,76 @@ jobs:
fail_ci_if_error: true
files: ./coverage-integration.txt, ./coverage-unit.txt
verbose: true
Compile-and-upload-binaries:
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
# we cannot use 1.20.6 version of go bc of a bug in go 1.20.6 that affects testcontainers
# should be changed back '1.20' once this is fixed
go-version: '1.20.5'
cache: true
- name: goreleaser
run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt update
sudo apt install goreleaser
GIT_HASH=$(git rev-parse --short HEAD) goreleaser build --clean --snapshot
- name: Upload macos
uses: actions/upload-artifact@v3
with:
name: binaries-macos-unsigned
path: dist/weaviate_darwin_all
- name: Upload windows
uses: actions/upload-artifact@v3
with:
name: binaries-windows-amd64
path: dist/weaviate_windows_amd64_v1
- name: Upload windows
uses: actions/upload-artifact@v3
with:
name: binaries-windows-arm64
path: dist/weaviate_windows_arm64
- name: Upload linux amd64
uses: actions/upload-artifact@v3
with:
name: binaries-linux-amd64
path: dist/weaviate_linux_amd64_v1
- name: Upload linux arm64
uses: actions/upload-artifact@v3
with:
name: binaries-linux-arm64
path: dist/weaviate_linux_arm64


Acceptance-Tests-windows:
needs: Compile-and-upload-binaries
runs-on: windows-latest
env:
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: true
PERSISTENCE_DATA_PATH: /tmp
QUERY_DEFAULTS_LIMIT: 20
steps:
- uses: actions/checkout@v3
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: binaries-windows-amd64
- name: Set up Go
uses: actions/setup-go@v4
with:
# we cannot use 1.20.6 version of go bc of a bug in go 1.20.6 that affects testcontainers
# should be changed back '1.20' once this is fixed
go-version: '1.20.5'
cache: true
- name: start weaviate
shell: bash
run: ./weaviate.exe --scheme http --port 8080 &
- name: run acceptance tests
shell: bash
run: go test -count 1 -race test/acceptance/actions/*.go

Push-Docker:
needs: [Acceptance-Tests, Modules-Acceptance-Tests, Unit-Tests, Integration-Tests, Vulnerability-Scanning, Run-Swagger]
Expand Down
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ builds:
goos:
- linux
- darwin
- windows
main: ./cmd/weaviate-server
goarch:
- amd64
Expand Down
31 changes: 31 additions & 0 deletions test/acceptance/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

set -eou pipefail

function main() {
# needed for test/docker package during replication tests
export TEST_WEAVIATE_IMAGE=weaviate/test-server
# for now we need to run the tests sequentially, there seems to be some sort of issues with running them in parallel
for pkg in $(go list ./... | grep 'test/acceptance' | grep -v 'test/acceptance/stress_tests' ); do
if ! go test -count 1 -race "$pkg"; then
echo "Test for $pkg failed" >&2
return 1
fi
done
for pkg in $(go list ./... | grep 'test/acceptance/stress_tests' ); do
if ! go test -count 1 "$pkg"; then
echo "Test for $pkg failed" >&2
return 1
fi
done
# tests with go client are in a separate package with its own dependencies to isolate them
cd 'test/acceptance_with_go_client'
for pkg in $(go list ./... ); do
if ! go test -count 1 -race "$pkg"; then
echo "Test for $pkg failed" >&2
return 1
fi
done
}

main "$@"
24 changes: 1 addition & 23 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,29 +118,7 @@ function run_integration_tests() {
}

function run_acceptance_tests() {
# needed for test/docker package during replication tests
export TEST_WEAVIATE_IMAGE=weaviate/test-server
# for now we need to run the tests sequentially, there seems to be some sort of issues with running them in parallel
for pkg in $(go list ./... | grep 'test/acceptance' | grep -v 'test/acceptance/stress_tests' ); do
if ! go test -count 1 -race "$pkg"; then
echo "Test for $pkg failed" >&2
return 1
fi
done
for pkg in $(go list ./... | grep 'test/acceptance/stress_tests' ); do
if ! go test -count 1 "$pkg"; then
echo "Test for $pkg failed" >&2
return 1
fi
done
# tests with go client are in a separate package with its own dependencies to isolate them
cd 'test/acceptance_with_go_client'
for pkg in $(go list ./... ); do
if ! go test -count 1 -race "$pkg"; then
echo "Test for $pkg failed" >&2
return 1
fi
done
./test/acceptance/run.sh --include-slow
}

function run_module_tests() {
Expand Down

0 comments on commit 3c10ab8

Please sign in to comment.