-
Notifications
You must be signed in to change notification settings - Fork 49
105 lines (91 loc) · 3.31 KB
/
wasmcloud_host.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
name: WasmcloudHost Elixir CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
working-directory: wasmcloud_host
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
elixir: [1.14.3]
otp: [25]
name: Build and test
runs-on: ${{ matrix.os }}
env:
MIX_ENV: test
steps:
- uses: actions/checkout@v3
# Install Rust
- run: rustup toolchain install stable --profile minimal
# Install erlang/OTP and elixir
- name: Install erlang and elixir
if: ${{ startswith(matrix.os, 'ubuntu') || startswith(matrix.os, 'windows') }}
uses: erlef/setup-beam@v1
with:
otp-version: "=${{ matrix.otp }}"
elixir-version: ${{ matrix.elixir }}
install-hex: true
install-rebar: true
- name: Install erlang and elixir
if: ${{ startswith(matrix.os, 'macos') }}
run: |
brew install erlang
brew install elixir
- name: Retrieve Mix Dependencies Cache
if: ${{ !startswith(matrix.os, 'windows') }} # Windows gets angry about not owning files if you restore from cache
uses: actions/cache@v2
id: mix-cache #id to use in retrieve action
with:
path: |
wasmcloud_host/deps
wasmcloud_host/_build
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles('wasmcloud_host/mix.exs', 'wasmcloud_host/mix.lock') }}
# Cache Rust builds
- uses: Swatinem/rust-cache@v2
with:
cache-directories: "host_core/native/hostcore_wasmcloud_native/target"
- name: Install Rebar and Hex
working-directory: ${{env.working-directory}}
run: |
mix local.rebar --force
mix local.hex --force
- name: Install Mix Dependencies
working-directory: ${{env.working-directory}}
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix do deps.get, deps.compile
- name: Check Formatting
if: ${{ !startswith(matrix.os, 'windows') }} # Windows gets angry about carriage returns
working-directory: ${{env.working-directory}}
run: mix format --check-formatted
- name: Ensure static files build properly
working-directory: ${{env.working-directory}}
shell: bash
env:
MIX_ENV: dev
run: make esbuild
- name: Run Credo
working-directory: ${{env.working-directory}}
continue-on-error: true # Don't fail entire action with refactoring opportunities for now
run: mix credo --strict
- name: Retrieve PLT Cache
uses: actions/cache@v2
id: plt-cache
with:
path: wasmcloud_host/priv/plts
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-plts-${{ hashFiles('wasmcloud_host/mix.exs', 'wasmcloud_host/mix.lock') }}
- name: Create PLTs
if: steps.plt-cache.outputs.cache-hit != 'true' && !startswith(matrix.os, 'windows')
working-directory: ${{env.working-directory}}
run: |
mkdir -p priv/plts
mix dialyzer --plt
- name: Run dialyzer
if: ${{ !startswith(matrix.os, 'windows') }}
working-directory: ${{env.working-directory}}
run: mix dialyzer