-
Notifications
You must be signed in to change notification settings - Fork 48
130 lines (111 loc) · 3.94 KB
/
build.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
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
127
128
129
130
name: build
on: push
jobs:
test:
runs-on: ${{ matrix.os.runner }}
name: ${{ matrix.os.name }} / OTP ${{matrix.beam.otp}} / Elixir ${{matrix.beam.elixir}}
strategy:
matrix:
beam:
- { otp: '27', elixir: '1.17' }
- { otp: '26', elixir: '1.16' }
- { otp: '26', elixir: '1.15' }
- { otp: '25', elixir: '1.14' }
- { otp: '25', elixir: '1.13' }
- { otp: '24', elixir: '1.12' }
os:
- name: Linux
runner: ubuntu-latest
include:
- os: { name: Windows, runner: windows-latest }
beam: { otp: '27', elixir: '1.17' }
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.beam.otp }}
elixir-version: ${{ matrix.beam.elixir }}
- name: Retrieve tty0tty Cache
if: runner.os == 'Linux'
uses: actions/cache@v3
id: tty0tty-cache
with:
path: tty0tty
key: tty0tty
- name: Install tty0tty
if: runner.os == 'Linux' && steps.tty0tty-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/colinleroy/tty0tty.git
- name: Set up tty0tty
if: runner.os == 'Linux'
run: |
cd tty0tty/module
make
sudo cp tty0tty.ko /lib/modules/$(uname -r)/kernel/drivers/misc/
sudo depmod
sudo modprobe tty0tty
sudo chmod 666 /dev/tnt*
- name: Retrieve com0com Cache
if: runner.os == 'Windows'
uses: actions/cache@v3
id: com0com-cache
with:
path: com0com
key: com0com
- name: Install com0com
if: runner.os == 'Windows' && steps.com0com-cache.outputs.cache-hit != 'true'
run: |
$Url = 'https://sourceforge.net/projects/signed-drivers/files/com0com/v3.0/com0com-3.0.0.0-i386-and-x64-signed.zip/download'
mkdir com0com | cd
curl --location $Url --output com0com.zip --silent
7z e com0com.zip amd64/* -r | Out-Null
$ExportType = [System.Security.Cryptography.X509Certificates.X509ContentType]::Cert
$cert = (Get-AuthenticodeSignature 'com0com.sys').SignerCertificate
Export-Certificate -Cert $cert -FilePath com0com.cer
- name: Set up com0com
if: runner.os == 'Windows'
run: |
cd com0com
Import-Certificate -FilePath com0com.cer -CertStoreLocation Cert:\LocalMachine\TrustedPublisher
./setupc.exe --silent install - -
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v3
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: mix deps.get
- name: mix test
if: runner.os == 'Windows'
run: |
$Env:CIRCUITS_UART_PORT1 = 'CNCA0'
$Env:CIRCUITS_UART_PORT2 = 'CNCB0'
mix test
- name: mix test
if: runner.os == 'Linux'
run: CIRCUITS_UART_PORT1=tnt0 CIRCUITS_UART_PORT2=tnt1 mix test
checks:
runs-on: ubuntu-latest
name: Extra checks
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
with:
otp-version: 26
elixir-version: 1.15
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v3
id: mix-cache
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- run: mix deps.get
- run: mix compile
- run: mix docs
- run: mix format --check-formatted
- run: mix deps.unlock --check-unused
- run: mix hex.build
- run: mix credo -a
- run: mix dialyzer