Skip to content

chore: Remove superseded chart to avoid confusion (#650) #1711

chore: Remove superseded chart to avoid confusion (#650)

chore: Remove superseded chart to avoid confusion (#650) #1711

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