Skip to content

test(ci) Migrate from CircleCI to Github Actions. #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 0 additions & 72 deletions .circleci/config.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on: [push]

jobs:
# The `lint` job.
lint:
name: Lint

runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Rust
shell: bash
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Set up Clippy
shell: bash
run: |
rustup component add clippy

- name: Lint Rust code
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
64 changes: 64 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and Test

on: [push]

jobs:
# The `test` job.
test:
name: Test

strategy:
matrix:
# The job runs on 2 different OS.
os: [ubuntu-latest, macos-latest]
# As soon as one job fails in the matrix, all the other
# in-progress jobs are canceled.
fail-fast: true

runs-on: ${{ matrix.os }}

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Rust
shell: bash
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y

- name: Cache Cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo bin
uses: actions/cache@v1
with:
path: ~/.cargo/bin
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }}

- name: Cache Cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Set up just
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
test -f $HOME/.cargo/bin/just || cargo install just

- name: Compile the library
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
just build

- name: Run all the tests
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
gem install bundler
just test
6 changes: 5 additions & 1 deletion bors.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
status = [ "ci/circleci: build-and-test" ]
status = [
"Test (ubuntu-latest)",
"Test (macos-latest)",
"Lint",
]
required_approvals = 0
timeout_sec = 900
delete_merged_branches = true
6 changes: 3 additions & 3 deletions src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use rutie::{
wrappable_struct, AnyException, AnyObject, Array, Boolean, Exception, Fixnum, Float, Module,
NilClass, Object, RString, Symbol,
};
use std::{mem, rc::Rc};
use std::rc::Rc;
use wasmer_runtime::{self as runtime, imports, Export};
use wasmer_runtime_core::types::Type;

Expand Down Expand Up @@ -150,7 +150,7 @@ impl ExportedFunctions {
.call(function_arguments.as_slice())
.map_err(|e| AnyException::new("RuntimeError", Some(&format!("{}", e))))?;

if results.len() > 0 {
if !results.is_empty() {
Ok(match results[0] {
runtime::Value::I32(result) => Fixnum::new(result as i64).into(),
runtime::Value::I64(result) => Fixnum::new(result).into(),
Expand Down Expand Up @@ -203,7 +203,7 @@ pub extern "C" fn ruby_exported_functions_method_missing(
let arguments = Value::from(0);

unsafe {
let argv_pointer: *const Value = mem::transmute(argv);
let argv_pointer = argv as *const Value;

class::rb_scan_args(argc, argv_pointer, str_to_cstring("*").as_ptr(), &arguments)
};
Expand Down