-
Notifications
You must be signed in to change notification settings - Fork 31
134 lines (128 loc) · 4.22 KB
/
main.yaml
File metadata and controls
134 lines (128 loc) · 4.22 KB
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
on:
push:
branches:
- main
tags:
- "**"
pull_request:
env:
WEAVIATE_133: 1.33.18
WEAVIATE_134: 1.34.20
WEAVIATE_135: 1.35.16
WEAVIATE_136: 1.36.10
WEAVIATE_137: 1.37.2
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "24.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: "24.x", weaviate: $WEAVIATE_133 },
{ node: "24.x", weaviate: $WEAVIATE_134 },
{ node: "24.x", weaviate: $WEAVIATE_135 },
{ node: "24.x", weaviate: $WEAVIATE_136 },
{ node: "22.x", weaviate: $WEAVIATE_137 },
{ node: "24.x", weaviate: $WEAVIATE_137 },
]
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: "24.x", weaviate: $WEAVIATE_137 }]
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 authenticate with OIDC when publishing to npm
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: "24.x"
registry-url: "https://registry.npmjs.org"
- run: npm ci
- run: npm run build
- run: npm publish
- 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