Skip to content

Commit b9608e3

Browse files
authored
Merge pull request #28 from Hywan/gh-actions
test(ci) Migrate from CircleCI to Github Actions.
2 parents 9807e38 + a4031ac commit b9608e3

File tree

5 files changed

+102
-76
lines changed

5 files changed

+102
-76
lines changed

Diff for: .circleci/config.yml

-72
This file was deleted.

Diff for: .github/workflows/lint.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Lint
2+
3+
on: [push]
4+
5+
jobs:
6+
# The `lint` job.
7+
lint:
8+
name: Lint
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Rust
17+
shell: bash
18+
run: |
19+
curl https://sh.rustup.rs -sSf | sh -s -- -y
20+
21+
- name: Set up Clippy
22+
shell: bash
23+
run: |
24+
rustup component add clippy
25+
26+
- name: Lint Rust code
27+
uses: actions-rs/clippy-check@v1
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
args: --all-features

Diff for: .github/workflows/test.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and Test
2+
3+
on: [push]
4+
5+
jobs:
6+
# The `test` job.
7+
test:
8+
name: Test
9+
10+
strategy:
11+
matrix:
12+
# The job runs on 2 different OS.
13+
os: [ubuntu-latest, macos-latest]
14+
# As soon as one job fails in the matrix, all the other
15+
# in-progress jobs are canceled.
16+
fail-fast: true
17+
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: Check out code
22+
uses: actions/checkout@v2
23+
24+
- name: Set up Rust
25+
shell: bash
26+
run: |
27+
curl https://sh.rustup.rs -sSf | sh -s -- -y
28+
29+
- name: Cache Cargo registry
30+
uses: actions/cache@v1
31+
with:
32+
path: ~/.cargo/registry
33+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
34+
35+
- name: Cache Cargo bin
36+
uses: actions/cache@v1
37+
with:
38+
path: ~/.cargo/bin
39+
key: ${{ runner.os }}-cargo-bin-${{ hashFiles('**/Cargo.lock') }}
40+
41+
- name: Cache Cargo build
42+
uses: actions/cache@v1
43+
with:
44+
path: target
45+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
46+
47+
- name: Set up just
48+
shell: bash
49+
run: |
50+
export PATH="$HOME/.cargo/bin:$PATH"
51+
test -f $HOME/.cargo/bin/just || cargo install just
52+
53+
- name: Compile the library
54+
shell: bash
55+
run: |
56+
export PATH="$HOME/.cargo/bin:$PATH"
57+
just build
58+
59+
- name: Run all the tests
60+
shell: bash
61+
run: |
62+
export PATH="$HOME/.cargo/bin:$PATH"
63+
gem install bundler
64+
just test

Diff for: bors.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
status = [ "ci/circleci: build-and-test" ]
1+
status = [
2+
"Test (ubuntu-latest)",
3+
"Test (macos-latest)",
4+
"Lint",
5+
]
26
required_approvals = 0
37
timeout_sec = 900
48
delete_merged_branches = true

Diff for: src/instance.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rutie::{
1313
wrappable_struct, AnyException, AnyObject, Array, Boolean, Exception, Fixnum, Float, Module,
1414
NilClass, Object, RString, Symbol,
1515
};
16-
use std::{mem, rc::Rc};
16+
use std::rc::Rc;
1717
use wasmer_runtime::{self as runtime, imports, Export};
1818
use wasmer_runtime_core::types::Type;
1919

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

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

205205
unsafe {
206-
let argv_pointer: *const Value = mem::transmute(argv);
206+
let argv_pointer = argv as *const Value;
207207

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

0 commit comments

Comments
 (0)