-
Notifications
You must be signed in to change notification settings - Fork 32
39 lines (39 loc) · 1.03 KB
/
test-and-deploy.yml
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
name: Test and Deploy
on:
push:
release:
types: [published]
jobs:
test-and-deploy:
runs-on: ubuntu-22.04
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
env:
MIX_ENV: test
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
strategy:
matrix:
include:
- otp: "24"
elixir: "1.12"
nodejs: "18.x"
- otp: "26"
elixir: "1.16"
nodejs: "20.x"
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- uses: actions/setup-node@v4
with:
node-version: ${{matrix.nodejs}}
- run: mix deps.get
- run: mix compile
- run: npm install --prefix=test/js
- run: mix test
- if: matrix.elixir == '1.16'
run: mix format --check-formatted
- name: Deploy to Hex
if: ${{ github.event_name == 'release' && matrix.elixir == '1.16' }}
run: mix hex.publish --yes