Skip to content

Commit 3ebd967

Browse files
Initial commit
0 parents  commit 3ebd967

File tree

11 files changed

+191
-0
lines changed

11 files changed

+191
-0
lines changed

.env

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
QUERY_DEFAULTS_LIMIT=25
2+
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true
3+
PERSISTENCE_DATA_PATH=/var/lib/weaviate
4+
DEFAULT_VECTORIZER_MODULE=none
5+
CLUSTER_HOSTNAME=node1

.github/workflows/test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test Weaviate Server
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
weaviate-action:
7+
name: Start Weaviate Server
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v3
12+
13+
- uses: pnpm/action-setup@v2.0.1
14+
with:
15+
version: 6.32.2
16+
17+
- name: Setup Weaviate
18+
uses: ./
19+
with:
20+
weaviate-version: 'latest'
21+
weaviate-port: 8080
22+
23+
- name: Setup Node.js 16.x
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 16.x
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Run tests
32+
run: pnpm test ./test/connection

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# dependencies
2+
node_modules
3+
.pnp
4+
.pnp.js
5+
*-lock.*
6+
*.lock
7+
8+
# testing
9+
coverage
10+
11+
# misc
12+
.DS_Store
13+
*.pem
14+
15+
# debug
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
.pnpm-debug.log*

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
## 1.0.0
4+
5+
### Minor Changes
6+
- Initial release.

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM docker:stable
2+
COPY entrypoint.sh /entrypoint.sh
3+
RUN chmod +x /entrypoint.sh
4+
ENTRYPOINT ["/entrypoint.sh"]

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Jasper Alexander
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Weaviate GitHub Action
2+
3+
This GitHub Action starts a Weaviate server. You can configure the version an port that are being used. The default version is `latest` and the default port is `8080`.
4+
5+
## Usage
6+
7+
```yml
8+
name: Test Weaviate
9+
10+
on: [push]
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Setup Weaviate
17+
uses: JasperAlexander@weaviate-github-action@1.0.0
18+
with:
19+
- weaviate-version: 'latest'
20+
- weaviate-port: 8080
21+
```

action.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Weaviate GitHub Action'
2+
description: 'Start a Weaviate server'
3+
inputs:
4+
weaviate-version:
5+
description: 'Weaviate version to use (defaults to latest)'
6+
required: false
7+
default: 'latest'
8+
weaviate-port:
9+
description: 'Weaviate port to use (defaults to 8080)'
10+
required: false
11+
default: 8080
12+
runs:
13+
using: 'docker'
14+
image: 'Dockerfile'
15+
args:
16+
- ${{ inputs.weaviate-version }}
17+
- ${{ inputs.weaviate-port }}

entrypoint.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh -l
2+
3+
WEAVIATE_VERSION=$1
4+
WEAVIATE_PORT=$2
5+
6+
echo "::group::Starting Weaviate"
7+
echo " - version [$WEAVIATE_VERSION]"
8+
echo " - port [$WEAVIATE_PORT]"
9+
echo ""
10+
11+
docker run --name weaviate --publish $WEAVIATE_PORT:$WEAVIATE_PORT --env-file ./.env --detach semitechnologies/weaviate:$WEAVIATE_VERSION
12+
13+
if [ $? -ne 0 ]; then
14+
echo "Error starting Weaviate in Docker container"
15+
exit 2
16+
fi
17+
18+
echo "::endgroup::"

package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "@JasperAlexander/weaviate-github-action",
3+
"version": "1.0.0",
4+
"description": "Weaviate GitHub Action",
5+
"author": "Jasper Alexander",
6+
"license": "MIT",
7+
"homepage": "https://github.com/JasperAlexander/weaviate-github-action",
8+
"keywords": [
9+
"github",
10+
"github-action",
11+
"weaviate"
12+
],
13+
"bugs": {
14+
"url": "https://github.com/JasperAlexander/weaviate-github-action/issues"
15+
},
16+
"repository": {
17+
"type": "git",
18+
"url": "git+https://github.com/JasperAlexander/weaviate-github-action.git"
19+
},
20+
"scripts": {
21+
"test": "c8 --include=dist uvu --ignore fixtures",
22+
"posttest": "c8 report --reporter=html"
23+
},
24+
"devDependencies": {
25+
"c8": "^7.13.0",
26+
"graphql": "^16.6.0",
27+
"uvu": "^0.5.6",
28+
"weaviate-ts-client": "^1.3.2"
29+
},
30+
"engines": {
31+
"node": ">=14.0.0"
32+
}
33+
}

0 commit comments

Comments
 (0)