Skip to content

open api generator #191

open api generator

open api generator #191

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
# https://docs.github.com/en/actions/managing-workflow-runs/skipping-workflow-runs
# Workflows that would otherwise be triggered using `on: push` or
# `on: pull_request` won't be triggered if you add any of the
# following strings to the commit message in a push, or the HEAD
# commit of a pull request:
# - [skip ci]
# - [ci skip]
# - [no ci]
# - [skip actions]
# - [actions skip]
test:
runs-on: ubuntu-latest
env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LATEST_TYPESENSE: '27.1'
strategy:
matrix:
include:
- typesense: '0.25.2'
otp: '25'
elixir: '1.14'
lint: false
- typesense: '26.0'
otp: '25'
elixir: '1.14'
lint: false
- typesense: '27.1'
otp: '25'
elixir: '1.14'
lint: false
- typesense: '0.25.2'
otp: '27'
elixir: '1.17'
lint: false
- typesense: '26.0'
otp: '27'
elixir: '1.17'
lint: false
- typesense: '27.1'
otp: '27'
elixir: '1.17'
lint: true
services:
typesense:
image: typesense/typesense:${{ matrix.typesense }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Check for misspellings
uses: codespell-project/actions-codespell@v2
- name: Start Typesense
run: |
docker run -id \
-p 8108:8108 \
--name typesense \
-v /tmp/typesense-data:/data \
-v /tmp/typesense-analytics-data:/analytics-data \
typesense/typesense:${{ matrix.typesense}} \
--api-key=xyz \
--data-dir=/data \
--enable-search-analytics=true \
--analytics-dir=/analytics-data \
--analytics-flush-interval=60 \
--analytics-minute-rate-limit=100 \
--enable-cors
- name: Wait for Typesense to be healthy
shell: bash
run: |
start_time=$(date +%s)
timeout=30
counter=0
until curl -s http://localhost:8108/health | grep -q '"ok":true'; do
if [ $counter -eq $timeout ]; then
echo "Timed out waiting for Typesense to be healthy"
exit 1
fi
echo "Waiting for Typesense to be healthy..."
sleep 1
counter=$((counter + 1))
done
end_time=$(date +%s)
elapsed=$((end_time - start_time))
echo "Typesense healthcheck elapsed: ${elapsed}s"
- name: Setup Elixir/OTP
uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Cache dependencies/builds
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-typesense-${{ matrix.typesense}}-${{ matrix.otp}}-${{ matrix.elixir}}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-typesense-${{ matrix.typesense}}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-
- name: Install Dependencies
run: |
mix local.rebar --if-missing
mix local.hex --if-missing
mix deps.get
- 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
run: mix credo --all --strict
if: ${{ matrix.lint }}
- name: Check format files
run: mix format --check-formatted
if: ${{ matrix.lint }}
- name: Run tests
run: mix test --only ${{ matrix.typesense }}:true --trace
- name: Post test coverage to Coveralls
run: mix coveralls.github
if: ${{ matrix.lint }}