Skip to content

Commit 4ef3db7

Browse files
committed
separate ci for badges
1 parent ad10c87 commit 4ef3db7

5 files changed

Lines changed: 412 additions & 27 deletions

File tree

.github/dependabot.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ updates:
1212
labels:
1313
- "hex"
1414
- "dependencies"
15-
version: 2
16-
updates:
1715
- package-ecosystem: "github-actions"
1816
directory: "/"
1917
schedule:

.github/workflows/ci_v26.0.yml

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

.github/workflows/ci_v27.0.yml

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

0 commit comments

Comments
 (0)