-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
typesense-version: ["26.0"] | ||
typesense-port: ["8108:8108"] | ||
|
||
env: | ||
MIX_ENV: test | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
services: | ||
typesense: | ||
image: typesense/typesense:${{ matrix.typesense-version }} | ||
ports: | ||
- ${{matrix.typesense-port}} | ||
options: >- | ||
--health-cmd "curl -f http://localhost:8108/health" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
# - name: Start Typesense | ||
# run: | | ||
# docker run -d \ | ||
# -p ${{ matrix.typesense-port }} \ | ||
# --name typesense \ | ||
# -v /tmp/typesense-data:/data \ | ||
# typesense/typesense:${{ matrix.typesense-version}} \ | ||
# --api-key=xyz \ | ||
# --data-dir /data \ | ||
# --enable-cors | ||
|
||
# - name: Curl Typesense | ||
# run: sleep 1 && curl http://localhost:8108/health | ||
|
||
- name: Setup Elixir/OTP | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: "25" | ||
elixir-version: "1.14.x" | ||
|
||
- name: Cache dependencies/builds | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-mix-typesense-${{ matrix.typesense-version }}-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-mix-typesense-${{ matrix.typesense-version }} | ||
- 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 | ||
|
||
- name: Check retired dependencies | ||
run: mix hex.audit | ||
|
||
- name: Security audit of dependencies | ||
run: mix deps.audit | ||
|
||
- name: Compile project | ||
run: mix compile --all-warnings | ||
|
||
- name: run static analysis | ||
run: mix credo --all --strict | ||
|
||
- name: check format files | ||
run: mix format --check-formatted | ||
|
||
- name: Run tests | ||
run: mix test | ||
|
||
- name: Post test coverage to Coveralls | ||
run: mix coveralls.github |