-
Notifications
You must be signed in to change notification settings - Fork 199
96 lines (95 loc) · 3.13 KB
/
ci.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
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
main:
name: Linux (${{ matrix.working_directory }}, ${{ matrix.elixir }}, ${{ matrix.otp }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
working_directory: ["nx", "exla", "torchx"]
elixir: ["1.15.4", "1.16.2"]
otp: ["25.3"]
include:
- elixir: "1.16.2"
lint: true
defaults:
run:
working-directory: ${{ matrix.working_directory }}
env:
MIX_ENV: test
XLA_FLAGS: --xla_force_host_platform_device_count=2
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Retrieve dependencies cache
env:
cache-name: cache-mix-deps
uses: actions/cache@v3
id: mix-cache # id to use in retrieve action
with:
path: ${{ github.workspace }}/${{ matrix.working_directory }}/deps
key: ${{ runner.os }}-Elixir-v${{ matrix.elixir }}-OTP-${{ matrix.otp }}-${{ hashFiles(format('{0}/{1}/mix.lock', github.workspace, matrix.working_directory)) }}
- name: Install dependencies
if: ${{ steps.mix-cache.outputs.cache-hit != 'true' }}
run: mix deps.get
- name: Compile and check warnings
run: mix compile --warnings-as-errors
- name: Check formatting
if: ${{ matrix.lint }}
run: mix format --check-formatted
- name: Run epmd for distributed tests
run: epmd -daemon
- name: Run tests
run: mix test
win:
name: Windows (${{ matrix.working_directory }}, ${{ matrix.elixir }}, ${{ matrix.otp }})
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
working_directory: ["nx", "torchx"]
elixir: ["1.16.2"]
otp: ["25.2"]
defaults:
run:
working-directory: ${{ matrix.working_directory }}
env:
MIX_ENV: test
XLA_FLAGS: --xla_force_host_platform_device_count=2
steps:
- name: Configure Git
run: git config --global core.autocrlf input
working-directory: .
- uses: actions/checkout@v2
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: 14.2
vsversion: 2019
arch: x64
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Retrieve dependencies cache
env:
cache-name: cache-mix-deps
uses: actions/cache@v3
id: mix-cache # id to use in retrieve action
with:
path: ${{ github.workspace }}\${{ matrix.working_directory }}\deps
key: ${{ runner.os }}-Elixir-v${{ matrix.elixir }}-OTP-${{ matrix.otp }}-${{ hashFiles(format('{0}\{1}\mix.lock', github.workspace, matrix.working_directory)) }}
- name: Install dependencies
if: ${{ steps.mix-cache.outputs.cache-hit != 'true' }}
run: mix deps.get
- name: Compile and check warnings
run: mix compile --warnings-as-errors
- name: Run tests
run: mix test