Skip to content

Commit

Permalink
Support Typesense 27.1
Browse files Browse the repository at this point in the history
We also extend test coverage to include Elixir 1.17 / Erlang OTP 27 in
CI as well as refactor the config.
  • Loading branch information
kianmeng committed Nov 6, 2024
1 parent 7eb12bd commit cbf70a5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
47 changes: 35 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,34 @@ jobs:

strategy:
matrix:
typesense-version: ['0.25.2', '26.0']
typesense-port: ['8108:8108']
include:
- typesense: '0.25.2'
otp: '25'
elixir: '1.14'
- typesense: '26.0'
otp: '25'
elixir: '1.14'
- typesense: '27.1'
otp: '25'
elixir: '1.14'
- typesense: '0.25.2'
otp: '27'
elixir: '1.17'
- typesense: '26.0'
otp: '27'
elixir: '1.17'
- typesense: '27.1'
otp: '27'
elixir: '1.17'
lint: true

env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

services:
typesense:
image: typesense/typesense:${{ matrix.typesense-version }}
image: typesense/typesense:${{ matrix.typesense }}

steps:
- name: Checkout repo
Expand All @@ -41,10 +59,10 @@ jobs:
- name: Start Typesense
run: |
docker run -d \
-p ${{ matrix.typesense-port }} \
-p 8108:8108 \
--name typesense \
-v /tmp/typesense-data:/data \
typesense/typesense:${{ matrix.typesense-version}} \
typesense/typesense:${{ matrix.typesense}} \
--api-key=xyz \
--data-dir /data \
--enable-cors
Expand All @@ -55,18 +73,18 @@ jobs:
- name: Setup Elixir/OTP
uses: erlef/setup-beam@v1
with:
otp-version: '25'
elixir-version: '1.14.x'
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}

- name: Cache dependencies/builds
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-typesense-${{ matrix.typesense-version }}-${{ hashFiles('**/mix.lock') }}
key: ${{ runner.os }}-mix-typesense-${{ matrix.typesense}}-${{ matrix.otp}}-${{ matrix.elixir}}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-typesense-${{ matrix.typesense-version }}
${{ runner.os }}-mix-typesense-${{ matrix.typesense}}
- name: Install Dependencies
run: |
Expand All @@ -76,21 +94,26 @@ jobs:
- name: Find unused dependencies
run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}

- name: Check retired dependencies
run: mix hex.audit
if: ${{ matrix.lint }}

- name: Security audit of dependencies
run: mix deps.audit
if: ${{ matrix.lint }}

- name: Compile project
run: mix compile --all-warnings

- name: run static analysis
- name: Run static analysis
run: mix credo --all --strict
if: ${{ matrix.lint }}

# - name: check format files
# run: mix format --check-formatted
- name: Check format files
run: mix format --check-formatted
if: ${{ matrix.lint }}

- name: Run tests
run: mix test
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typesense:
image: docker.io/typesense/typesense:26.0
image: docker.io/typesense/typesense:27.1
container_name: typesense
restart: on-failure
ports:
Expand Down

0 comments on commit cbf70a5

Please sign in to comment.