Skip to content

Commit

Permalink
experiment with the circle config
Browse files Browse the repository at this point in the history
  • Loading branch information
tessi committed Jan 15, 2020
1 parent 80b1c2f commit 2696283
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 12 deletions.
43 changes: 34 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,48 @@
version: 2
jobs:
build:
parallelism: 1
docker:
# specify the version here
- image: circleci/elixir:1.9.1
environment:
MIX_ENV: test

working_directory: ~/repo
steps:
- checkout

- restore_cache:
keys:
- v1-dependency-cache-{{ checksum "mix.lock" }}
- v1-dependency-cache

- run: mix local.hex --force # install Hex locally (without prompt)
- run: mix local.rebar --force # fetch a copy of rebar (without prompt)
- run:
name: "Install Rust and WASM toolchain"
name: "Install Rust"
command: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y
source $HOME/.cargo/env
rustup component add rustfmt
rustup target add wasm32-unknown-unknown # to compile our example WASM files for testing
- run: mix deps.get
- run: mix test
- run: mix format --check-formatted
- run: cargo fmt --manifest-path native/wasmex/Cargo.toml -- --check
- run: mix dialyzer
- run: mix docs
- run:
name: "Run Checks (Tests, Formatters, ..)"
command: |
source $HOME/.cargo/env
mix deps.get
mix test
mix format --check-formatted
cargo fmt --manifest-path native/wasmex/Cargo.toml -- --check
mix dialyzer
mix docs
- save_cache:
key: v1-dependency-cache-{{ checksum "mix.lock" }}
paths:
- _build
- deps
- ~/.mix

- store_test_results:
path: _build/test/lib/wasmex
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ erl_crash.dump
wasmex-*.tar

# Cargo things in the Rust part of this package
Cargo.*
priv/native/libwasmex.so
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<a href="https://github.com/tessi/wasmex/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/wasmerio/wasmer.svg" alt="License">
</a>
[![CircleCI](https://circleci.com/gh/tessi/wasmex.svg?style=svg)](https://circleci.com/gh/tessi/wasmex)
</p>

Wasmex is an Elixir library for executing WebAssembly binaries:
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ defmodule Wasmex.MixProject do
defp deps do
[
{:rustler, "~> 0.21.0"},
{:ex_doc, "~> 0.21.2", only: :dev},
{:dialyxir, "~> 1.0.0-rc.7", only: [:dev], runtime: false}
{:ex_doc, "~> 0.21.2", only: [:dev, :test]},
{:dialyxir, "~> 1.0.0-rc.7", only: [:dev, :test], runtime: false}
]
end

Expand Down
5 changes: 5 additions & 0 deletions test/wasm_source/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions test/wasm_source/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "wasmex_test"
version = "0.1.0"
authors = ["Philipp Tessenow <philipp@tessenow.org>"]
edition = "2018"

[dependencies]

[lib]
crate-type =["cdylib"]

0 comments on commit 2696283

Please sign in to comment.