Skip to content

Merge pull request #3374 from weaviate/v1-21-rc-0-release #2

Merge pull request #3374 from weaviate/v1-21-rc-0-release

Merge pull request #3374 from weaviate/v1-21-rc-0-release #2

name: Tests
on:
push:
branches:
- master
tags:
- '**'
pull_request:
jobs:
Run-Swagger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: true
- name: Run Swagger
run: ./tools/gen-code-from-swagger.sh
- name: Error on change
run: |
# check if anything is different
CHANGED=$(git status -s | wc -l)
if [ "$CHANGED" -gt 0 ]; then
echo "Please run ./tools/gen-code-from-swagger.sh script and commit changes"
exit 1
else
exit 0
fi
Vulnerability-Scanning:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork }} # no PRs from fork
steps:
- uses: actions/checkout@v3
- name: Scan for Vulnerabilities in Code
uses: Templum/govulncheck-action@v1.0.0
with:
go-version: '1.20'
package: ./...
fail-on-vuln: true
Unit-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: true
- name: Unit test
run: ./test/run.sh --unit-only
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: coverage-report-unit
path: coverage-unit.txt
Integration-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: true
- name: Integration test
run: ./test/run.sh --integration-only
- name: Archive code coverage results
uses: actions/upload-artifact@v3
with:
name: coverage-report-integration
path: coverage-integration.txt
Modules-Acceptance-Tests:
runs-on: ubuntu-latest-8-cores
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: true
- name: Acceptance tests (modules)
run: ./test/run.sh --acceptance-module-tests-only
Acceptance-Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: true
- name: Acceptance tests
env:
WCS_DUMMY_CI_PW: ${{ secrets.WCS_DUMMY_CI_PW }}
WCS_DUMMY_CI_PW_2: ${{ secrets.WCS_DUMMY_CI_PW_2 }}
run: ./test/run.sh --acceptance-only
Codecov:
needs: [Unit-Tests, Integration-Tests]
runs-on: ubuntu-latest
if: ${{ (github.ref_type == 'branch') && (github.ref_name != 'master') }}
steps:
- uses: actions/checkout@v3
- name: Download coverage artifacts integration
uses: actions/download-artifact@v3
with:
name: coverage-report-unit
- name: Download coverage unit
uses: actions/download-artifact@v3
with:
name: coverage-report-integration
- name: Codecov
uses: codecov/codecov-action@v3
with:
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:
go-version: '1.20'
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:
go-version: '1.20'
cache: true
- name: start weaviate
shell: bash
# Weaviate is started without a Vectorizer as running text2vec-contextionary on GH actions is difficult:
# - docker on GHA only supports windows container - which we currently are not build
# - building those containers without a windows machine is difficult to figure out
run: ./weaviate.exe --scheme http --port 8080 &
- name: run acceptance tests
shell: bash
run: go test -count 1 -race test/acceptance/actions/*.go # tests that don't need a Vectorizer
Push-Docker:
needs: [Acceptance-Tests, Modules-Acceptance-Tests, Unit-Tests, Integration-Tests, Vulnerability-Scanning, Run-Swagger]
runs-on: ubuntu-latest-8-cores
if: ${{ !github.event.pull_request.head.repo.fork }} # no PRs from fork
steps:
- uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: Push container
id: push-container
run: ./ci/push_docker.sh
env:
PR_TITLE: "${{ github.event.pull_request.title }}"
- name: Generate Report
env:
PREVIEW_TAG: "${{ steps.push-container.outputs.PREVIEW_TAG }}"
run: ./ci/generate_docker_report.sh