-
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 2.11 KB
/
elixir.yml
File metadata and controls
76 lines (68 loc) · 2.11 KB
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
# SPDX-License-Identifier: MPL-2.0
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Elixir CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
timeout-minutes: 30
env:
MIX_ENV: test
POSTGRES_PASSWORD: ${{ github.run_id }}
ARANGO_USERNAME: root
ARANGO_PASSWORD: ${{ github.run_id }}
services:
postgres:
image: postgres:16-alpine@sha256:79950da386bda7fcc9d57aa9aa9be6c6d7407596a9b8f68014b09a778a9ab316
env:
POSTGRES_PASSWORD: ${{ github.run_id }}
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
arangodb:
image: arangodb:3.12@sha256:95567b13d74dbec3869468f88c31a53ae598fa5f90e0e2e582df89b7b6893ae7
env:
ARANGO_ROOT_PASSWORD: ${{ github.run_id }}
ports:
- 8529:8529
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up Elixir
uses: erlef/setup-beam@fc68ffb90438ef2936bbb3251622353b3dcb2f93 # v1.24.0
with:
elixir-version: '1.18.2'
otp-version: '27.2.1'
- name: Restore dependencies cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: mix deps.get
- name: Wait for ArangoDB
run: |
for attempt in $(seq 1 30); do
if curl -fsS -u "root:${ARANGO_PASSWORD}" http://localhost:8529/_api/version >/dev/null; then
exit 0
fi
sleep 2
done
echo "::error::ArangoDB did not become ready"
exit 1
- name: Run tests
run: mix test