-
Notifications
You must be signed in to change notification settings - Fork 12
122 lines (102 loc) · 3.01 KB
/
ci.yml
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
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
strategy:
matrix:
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 }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Start Typesense
run: |
docker run -d \
-p 8108:8108 \
--name typesense \
-v /tmp/typesense-data:/data \
typesense/typesense:${{ matrix.typesense}} \
--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: ${{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}}-${{ matrix.otp}}-${{ matrix.elixir}}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-typesense-${{ matrix.typesense}}
- 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
- name: Post test coverage to Coveralls
run: mix coveralls.github