Skip to content

Commit 9777622

Browse files
authored
Add support for v29.0 (#35)
1 parent d3c04c7 commit 9777622

114 files changed

Lines changed: 2996 additions & 737 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci_v26.0.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: CI v26.0
22

33
on:
4-
push:
5-
branches: ["main"]
64
pull_request:
75
branches: ["main"]
86

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
911
jobs:
1012
# https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
1113
# Workflows that would otherwise be triggered using `on: push` or
@@ -19,7 +21,9 @@ jobs:
1921
# - [actions skip]
2022

2123
test:
24+
if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'jaeyson/open_api_typesense' }}
2225
runs-on: ubuntu-latest
26+
environment: review
2327

2428
env:
2529
MIX_ENV: test

.github/workflows/ci_v27.0.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: CI v27.0
22

33
on:
4-
push:
5-
branches: ["main"]
64
pull_request:
75
branches: ["main"]
86

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
911
jobs:
1012
# https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
1113
# Workflows that would otherwise be triggered using `on: push` or
@@ -19,7 +21,9 @@ jobs:
1921
# - [actions skip]
2022

2123
test:
24+
if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'jaeyson/open_api_typesense' }}
2225
runs-on: ubuntu-latest
26+
environment: review
2327

2428
env:
2529
MIX_ENV: test

.github/workflows/ci_v27.1.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: CI v27.1
22

33
on:
4-
push:
5-
branches: ["main"]
64
pull_request:
75
branches: ["main"]
86

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
911
jobs:
1012
# https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
1113
# Workflows that would otherwise be triggered using `on: push` or
@@ -19,7 +21,9 @@ jobs:
1921
# - [actions skip]
2022

2123
test:
24+
if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'jaeyson/open_api_typesense' }}
2225
runs-on: ubuntu-latest
26+
environment: review
2327

2428
env:
2529
MIX_ENV: test

.github/workflows/ci_v28.0.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: CI v28.0
22

33
on:
4-
push:
5-
branches: ["main"]
64
pull_request:
75
branches: ["main"]
86

7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
911
jobs:
1012
# https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
1113
# Workflows that would otherwise be triggered using `on: push` or
@@ -19,7 +21,9 @@ jobs:
1921
# - [actions skip]
2022

2123
test:
24+
if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'jaeyson/open_api_typesense' }}
2225
runs-on: ubuntu-latest
26+
environment: review
2327

2428
env:
2529
MIX_ENV: test
@@ -36,11 +40,7 @@ jobs:
3640
- typesense: '28.0'
3741
otp: '27'
3842
elixir: '1.18'
39-
lint: false
40-
- typesense: '28.0'
41-
otp: '28'
42-
elixir: '1.19'
43-
lint: true
43+
lint: false
4444

4545
services:
4646
typesense:

.github/workflows/ci_v29.0.yml

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
name: CI v29.0
2+
3+
on:
4+
workflow_call:
5+
pull_request:
6+
branches: ["main"]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
# https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
14+
# Workflows that would otherwise be triggered using `on: push` or
15+
# `on: pull_request` won't be triggered if you add any of the
16+
# following strings to the commit message in a push, or the HEAD
17+
# commit of a pull request:
18+
# - [skip ci]
19+
# - [ci skip]
20+
# - [no ci]
21+
# - [skip actions]
22+
# - [actions skip]
23+
24+
test:
25+
if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'jaeyson/open_api_typesense' }}
26+
runs-on: ubuntu-latest
27+
environment: review
28+
29+
env:
30+
MIX_ENV: test
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
LATEST_TYPESENSE: '29.0'
33+
34+
strategy:
35+
matrix:
36+
include:
37+
- typesense: '29.0'
38+
otp: '25'
39+
elixir: '1.14'
40+
lint: false
41+
- typesense: '29.0'
42+
otp: '28'
43+
elixir: '1.18'
44+
lint: true
45+
46+
services:
47+
typesense:
48+
image: typesense/typesense:${{ matrix.typesense }}
49+
50+
steps:
51+
- name: Checkout repo
52+
uses: actions/checkout@v4
53+
54+
- name: Check for misspellings
55+
uses: codespell-project/actions-codespell@v2
56+
57+
- name: Start Typesense
58+
run: |
59+
docker run -id \
60+
-p 8108:8108 \
61+
--name typesense \
62+
-v /tmp/typesense-data:/data \
63+
-v /tmp/typesense-analytics-data:/analytics-data \
64+
typesense/typesense:${{ matrix.typesense}} \
65+
--api-key xyz \
66+
--data-dir /data \
67+
--enable-search-analytics=true \
68+
--analytics-dir=/analytics-data \
69+
--analytics-flush-interval=60 \
70+
--analytics-minute-rate-limit=100 \
71+
--enable-cors
72+
73+
- name: Wait for Typesense to be healthy
74+
shell: bash
75+
run: |
76+
start_time=$(date +%s)
77+
timeout=30
78+
counter=0
79+
until curl -s http://localhost:8108/health | grep -q '"ok":true'; do
80+
if [ $counter -eq $timeout ]; then
81+
echo "Timed out waiting for Typesense to be healthy"
82+
exit 1
83+
fi
84+
echo "Waiting for Typesense to be healthy..."
85+
sleep 1
86+
counter=$((counter + 1))
87+
done
88+
end_time=$(date +%s)
89+
elapsed=$((end_time - start_time))
90+
echo "Typesense healthcheck elapsed: ${elapsed}s"
91+
92+
- name: Setup Elixir/OTP
93+
uses: erlef/setup-beam@v1
94+
with:
95+
otp-version: ${{matrix.otp}}
96+
elixir-version: ${{matrix.elixir}}
97+
98+
- name: Cache dependencies/builds
99+
uses: actions/cache@v4
100+
with:
101+
path: |
102+
deps
103+
_build
104+
key: ${{ runner.os }}-typesense-${{ matrix.typesense}}-${{ matrix.otp}}-${{ matrix.elixir}}-mix-${{ hashFiles('**/mix.lock') }}
105+
restore-keys: |
106+
${{ runner.os }}-typesense-${{ matrix.typesense}}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-
107+
108+
- name: Install Dependencies
109+
run: |
110+
mix local.rebar --if-missing
111+
mix local.hex --if-missing
112+
mix deps.get
113+
114+
- name: Find unused dependencies
115+
run: mix deps.unlock --check-unused
116+
if: ${{ matrix.lint }}
117+
118+
- name: Check retired dependencies
119+
run: mix hex.audit
120+
if: ${{ matrix.lint }}
121+
122+
- name: Security audit of dependencies
123+
run: mix deps.audit
124+
if: ${{ matrix.lint }}
125+
126+
- name: Compile project
127+
run: mix compile --all-warnings
128+
129+
- name: Run static analysis
130+
run: mix credo --all --strict
131+
if: ${{ matrix.lint }}
132+
133+
- name: Check format files
134+
run: mix format --check-formatted
135+
if: ${{ matrix.lint }}
136+
137+
- name: Restore PLT cache
138+
id: plt_cache
139+
uses: actions/cache/restore@v4
140+
with:
141+
key: |
142+
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
143+
restore-keys: |
144+
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-
145+
path: |
146+
priv/plts
147+
if: ${{ matrix.lint }}
148+
149+
- name: Create PLTs
150+
if: ${{ steps.plt_cache.outputs.cache-hit != 'true' && matrix.lint }}
151+
run: mix dialyzer --plt
152+
153+
- name: Save PLT cache
154+
id: plt_cache_save
155+
uses: actions/cache/save@v4
156+
if: ${{ steps.plt_cache.outputs.cache-hit != 'true' && matrix.lint }}
157+
with:
158+
key: |
159+
plt-${{ runner.os }}-${{ steps.beam.outputs.otp-version }}-${{ steps.beam.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
160+
path: |
161+
priv/plts
162+
163+
- name: Dialyzer
164+
run: mix dialyzer --format github --format dialyxir
165+
if: ${{ matrix.lint }}
166+
167+
- name: Run tests
168+
run: mix test --only ${{ matrix.typesense }}:true --only nls:true --trace
169+
170+
- name: Post test coverage to Coveralls
171+
run: mix coveralls.github
172+
if: ${{ matrix.lint && github.event_name == 'push' && github.ref == 'refs/heads/main' }}

.github/workflows/llm.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: LLM
2+
on:
3+
pull_request:
4+
branches: ["main"]
5+
6+
# concurrency:
7+
# group: ${{ github.workflow }}-${{ github.ref }}
8+
# cancel-in-progress: true
9+
10+
jobs:
11+
ci_workflow:
12+
uses: ./.github/workflows/ci_v29.0.yml
13+
secrets: inherit
14+
15+
llm:
16+
if: ${{ (github.event_name == 'push' || github.event_name == 'pull_request') && github.repository == 'jaeyson/open_api_typesense' }}
17+
runs-on: ubuntu-latest
18+
environment: review
19+
needs: [ci_workflow]
20+
21+
env:
22+
MIX_ENV: test
23+
24+
strategy:
25+
matrix:
26+
include:
27+
- typesense: '29.0'
28+
otp: '28'
29+
elixir: '1.18'
30+
31+
services:
32+
typesense:
33+
image: typesense/typesense:${{ matrix.typesense }}
34+
35+
steps:
36+
- name: Start Typesense
37+
run: |
38+
docker run -id \
39+
-p 8108:8108 \
40+
--name typesense \
41+
-v /tmp/typesense-data:/data \
42+
-v /tmp/typesense-analytics-data:/analytics-data \
43+
typesense/typesense:${{ matrix.typesense}} \
44+
--api-key xyz \
45+
--data-dir /data \
46+
--enable-search-analytics=true \
47+
--analytics-dir=/analytics-data \
48+
--analytics-flush-interval=60 \
49+
--analytics-minute-rate-limit=100 \
50+
--enable-cors
51+
52+
- name: Wait for Typesense to be healthy
53+
shell: bash
54+
run: |
55+
start_time=$(date +%s)
56+
timeout=30
57+
counter=0
58+
until curl -s http://localhost:8108/health | grep -q '"ok":true'; do
59+
if [ $counter -eq $timeout ]; then
60+
echo "Timed out waiting for Typesense to be healthy"
61+
exit 1
62+
fi
63+
echo "Waiting for Typesense to be healthy..."
64+
sleep 1
65+
counter=$((counter + 1))
66+
done
67+
end_time=$(date +%s)
68+
elapsed=$((end_time - start_time))
69+
echo "Typesense healthcheck elapsed: ${elapsed}s"
70+
71+
- name: Checkout repo
72+
uses: actions/checkout@v5
73+
74+
- name: Setup Elixir/OTP
75+
uses: erlef/setup-beam@v1
76+
with:
77+
otp-version: ${{matrix.otp}}
78+
elixir-version: ${{matrix.elixir}}
79+
80+
- name: Cache typesense-data
81+
uses: actions/cache@v4
82+
with:
83+
path: |
84+
typesense-data
85+
key: ${{ runner.os }}-typesense-data
86+
restore-keys: |
87+
${{ runner.os }}-typesense-data
88+
89+
- name: Test natural language search
90+
run: mix test --only nls:true --trace
91+
if: ${{ github.event_name == 'pull_request' && github.ref == 'refs/heads/main' }}
92+
93+
- name: Post test coverage to Coveralls
94+
run: mix coveralls.github
95+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,7 @@ open_api_typesense-*.tar
3636
.elixir_ls
3737
**.DS_Store
3838

39+
*.env
40+
3941
/priv/plts/*.plt
4042
/priv/plts/*.plt.hash

0 commit comments

Comments
 (0)