-
Notifications
You must be signed in to change notification settings - Fork 25
136 lines (131 loc) · 4.2 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
on:
push:
branches:
- main
tags:
- '**'
pull_request:
env:
WEAVIATE_124: 1.24.26
WEAVIATE_125: 1.25.30
WEAVIATE_126: 1.26.14
WEAVIATE_127: 1.27.11
WEAVIATE_128: 1.28.4
WEAVIATE_129: 1.29.0
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '22.x'
- name: "Run checks"
run: |
npm ci
npm run lint
npm run format:check
npm run docs
tests-without-auth:
needs: checks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
versions: [
{ node: "22.x", weaviate: $WEAVIATE_124},
{ node: "22.x", weaviate: $WEAVIATE_125},
{ node: "22.x", weaviate: $WEAVIATE_126},
{ node: "22.x", weaviate: $WEAVIATE_127},
{ node: "22.x", weaviate: $WEAVIATE_128},
{ node: "18.x", weaviate: $WEAVIATE_129},
{ node: "20.x", weaviate: $WEAVIATE_129},
{ node: "22.x", weaviate: $WEAVIATE_129}
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.versions.node }}
- name: Login to Docker Hub
if: ${{ !github.event.pull_request.head.repo.fork && github.triggering_actor != 'dependabot[bot]' }}
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: "Install dependencies"
run: |
npm ci
ci/run_dependencies.sh ${{ matrix.versions.weaviate }}
- name: "Run tests without authentication tests"
run: WEAVIATE_VERSION=${{ matrix.versions.weaviate }} npm test
- name: "Transpile the package"
run: npm run build
- name: "Stop Weaviate"
run: ci/stop_dependencies.sh ${{ matrix.versions.weaviate }}
tests-with-auth:
needs: checks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
versions: [
{ node: "22.x", weaviate: $WEAVIATE_129}
]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.versions.node }}
- name: Login to Docker Hub
if: ${{ !github.event.pull_request.head.repo.fork && github.triggering_actor != 'dependabot[bot]' }}
uses: docker/login-action@v3
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: "Install dependencies"
run: |
npm ci
ci/run_dependencies.sh ${{ matrix.versions.weaviate }}
- name: "Run tests with authentication tests"
if: ${{ !github.event.pull_request.head.repo.fork }}
env:
OKTA_DUMMY_CI_PW: ${{ secrets.OKTA_DUMMY_CI_PW }}
WCS_DUMMY_CI_PW: ${{ secrets.WCS_DUMMY_CI_PW }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
OKTA_CLIENT_SECRET: ${{ secrets.OKTA_CLIENT_SECRET }}
run: WEAVIATE_VERSION=${{ matrix.versions.weaviate }} npm test
- name: "Stop Weaviate"
run: ci/stop_dependencies.sh ${{ matrix.versions.weaviate }}
publish:
needs: [tests-with-auth, tests-without-auth]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
permissions:
contents: write # to upload the release
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
- run: npm run docs
- name: "Upload docs as pages artifact"
uses: actions/upload-pages-artifact@v3
with:
path: ./docs
- name: "Deploy the uploaded pages artifact"
uses: actions/deploy-pages@v4
- name: "Create a GitHub release"
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
draft: true