-
Notifications
You must be signed in to change notification settings - Fork 500
126 lines (104 loc) · 3.23 KB
/
ci.yml
File metadata and controls
126 lines (104 loc) · 3.23 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
124
125
126
name: CI
on:
pull_request:
push:
branches:
- main
- "v*.*"
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
env:
MIX_ENV: test
steps:
- name: Checkout git repo
uses: actions/checkout@v6
- name: Read ./versions
run: |
. versions
echo "elixir=$elixir" >> $GITHUB_ENV
echo "otp=$otp" >> $GITHUB_ENV
- name: Install Erlang & Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.otp }}
elixir-version: ${{ env.elixir }}
- name: Cache Mix
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-
- name: Restore bun cache
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('assets/bun.lock') }}
- name: Install mix dependencies
run: mix deps.get
- name: Check formatting
run: mix format --check-formatted
- name: Check warnings
run: mix compile --warnings-as-errors
- name: Run tests
run: mix test
env:
TEST_GIT_SSH_KEY: ${{ secrets.TEST_GIT_SSH_KEY }}
- name: Install bun dependencies
run: |
mix bun.install --if-missing
mix bun assets install
- name: Check assets formatting
run: mix bun assets run format-check
- name: Run assets tests
run: mix bun assets run test
windows:
name: Windows
runs-on: windows-2022
if: github.event_name == 'push'
env:
MIX_ENV: test
steps:
- name: Configure Git
run: git config --global core.autocrlf input
- name: Checkout git repo
uses: actions/checkout@v6
- name: Read ./versions
shell: bash
run: |
. versions
echo "elixir=$elixir" >> $GITHUB_ENV
echo "otp=$otp" >> $GITHUB_ENV
- name: Install Erlang & Elixir
uses: erlef/setup-beam@v1
with:
version-type: strict
otp-version: ${{ env.otp }}
elixir-version: ${{ env.elixir }}
# Add tar that supports symlinks, see https://github.com/actions/virtual-environments/issues/4679
- name: Add tar.exe
run: |
"C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Cache Mix
uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-${{ hashFiles('**/mix.lock') }}
# Reinstalling deps fails on Windows in rare cases, so we always use a new cache
# restore-keys: |
# ${{ runner.os }}-mix-${{ env.elixir }}-${{ env.otp }}-
# Setup nmake, in case we need to compile Pythonx from source
- uses: ilammy/msvc-dev-cmd@v1
- name: Install mix dependencies
run: mix deps.get
- name: Run tests
run: mix test
env:
TEST_GIT_SSH_KEY: ${{ secrets.TEST_GIT_SSH_KEY }}