-
-
Notifications
You must be signed in to change notification settings - Fork 410
124 lines (103 loc) · 3.96 KB
/
ci.yml
File metadata and controls
124 lines (103 loc) · 3.96 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
122
123
# This workflow will do a clean install of the dependencies and run tests across different versions
#
# Requires scripts:
# - bin/ci.sh
# - bin/ci-check.sh
name: elixir / main ci
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
precheck:
runs-on: ubuntu-24.04
strategy:
matrix:
elixir: [1.19.2]
otp: [28.1]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Use Elixir
uses: erlef/setup-beam@3580539ceec3dc05b0ed51e9e10b08eb7a7c2bb4
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Set cache key
id: set_cache_key
run: |
erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell > ERLANG_VERSION
cat ERLANG_VERSION
elixir --version | tail -n 1 > ELIXIR_VERSION
cat ELIXIR_VERSION
cache_key="os-${{ runner.os }}-erlang-$( sha256sum ERLANG_VERSION | cut -d ' ' -f 1 )-elixir-$( sha256sum ELIXIR_VERSION | cut -d ' ' -f 1 )-mix-lock-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}"
echo "::set-output name=cache_key::$cache_key"
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
id: mix-cache # id to use in retrieve action
with:
path: deps
key: mix-${{ steps.set_cache_key.outputs.cache_key }}-v1
- name: Install Mix Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: Build Project
run: mix
- name: Retrieve PLT Cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
id: plt-cache
with:
path: priv/plts
key: plts-${{ steps.set_cache_key.outputs.cache_key }}-v1
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true'
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run Prechecks
run: bin/ci-check.sh
ci:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- elixir: '1.15.0'
otp: '26.0'
- elixir: '1.16.0'
otp: '26.2'
- elixir: '1.17.0'
otp: '27.0'
- elixir: '1.18.1'
otp: '27.2'
- elixir: '1.19.2'
otp: '28.1'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Use Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
uses: erlef/setup-beam@3580539ceec3dc05b0ed51e9e10b08eb7a7c2bb4
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Set cache key
id: set_cache_key
run: |
erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell > ERLANG_VERSION
cat ERLANG_VERSION
elixir --version | tail -n 1 > ELIXIR_VERSION
cat ELIXIR_VERSION
cache_key="os-${{ runner.os }}-erlang-$( sha256sum ERLANG_VERSION | cut -d ' ' -f 1 )-elixir-$( sha256sum ELIXIR_VERSION | cut -d ' ' -f 1 )-mix-lock-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}"
echo "::set-output name=cache_key::$cache_key"
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306
id: mix-cache # id to use in retrieve action
with:
path: deps
key: mix-${{ steps.set_cache_key.outputs.cache_key }}-v1
- name: Install Mix Dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: Build Project
run: mix
- name: Run Checks
run: bin/ci.sh