-
Notifications
You must be signed in to change notification settings - Fork 24
121 lines (99 loc) · 3.53 KB
/
Copy pathci.yml
File metadata and controls
121 lines (99 loc) · 3.53 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
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
name: ci
on:
pull_request:
workflow_dispatch:
push:
branches: [master]
schedule:
- cron: "42 9 * * *"
jobs:
test:
name: "test (Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }} / ClickHouse ${{ matrix.clickhouse || 'latest' }} / TZ ${{ matrix.timezone || 'UTC' }}${{ matrix.dialyzer && ' / Dialyzer' || '' }}${{ matrix.lint && ' / Lint' || '' }})"
runs-on: ubuntu-latest
strategy:
matrix:
include:
# some old elixir/erlang version
- elixir: 1.15
otp: 25
# some recent version and non-UTC timezone
- elixir: 1.18
otp: 27
timezone: Europe/Berlin
# the latest elixir/erlang version with all static checks
- elixir: 1.19
otp: 28
dialyzer: true
lint: true
coverage: true
# Plausible versions
# - https://github.com/plausible/analytics/blob/master/.tool-versions
# - https://github.com/plausible/analytics/blob/master/.github/workflows/elixir.yml
- elixir: 1.19.4
otp: 27.3.4.6
clickhouse: 25.11.5.8
# some older pre-JSON ClickHouse version
# https://github.com/plausible/ch/issues/273
- elixir: 1.18
otp: 28
clickhouse: 24.5.4.49
services:
clickhouse:
image: clickhouse/clickhouse-server:${{ matrix.clickhouse || 'latest' }}
ports:
- 8123:8123
env:
TZ: ${{ matrix.timezone || 'UTC' }}
# https://github.com/ClickHouse/ClickHouse/issues/75494
CLICKHOUSE_SKIP_USER_SETUP: 1
options: >-
--health-cmd nc -zw3 localhost 8124
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v6
- id: beam
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore deps cache
uses: actions/cache@v5
with:
path: |
deps
_build
key: test-${{ steps.beam.outputs.elixir-version }}-${{ github.head_ref || github.ref }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
test-${{ steps.beam.outputs.elixir-version }}-${{ github.head_ref || github.ref }}-
test-${{ steps.beam.outputs.elixir-version }}-refs/heads/master-
- run: mix deps.get --only $MIX_ENV
if: ${{ !matrix.lint }}
- run: mix deps.get --check-locked
if: ${{ matrix.lint }}
- run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- run: mix compile --warnings-as-errors
- run: mix format --check-formatted
if: ${{ matrix.lint }}
- run: mix test
if: ${{ !matrix.coverage }}
- run: mix coveralls.github
if: ${{ matrix.coverage }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Restore PLTs cache
if: ${{ matrix.dialyzer }}
uses: actions/cache@v5
with:
path: plts
key: plts-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-${{ github.head_ref || github.ref }}
restore-keys: |
plts-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-refs/heads/master
- run: mix dialyzer --format github
if: ${{ matrix.dialyzer }}
- uses: crate-ci/typos@master
if: ${{ matrix.lint }}