Skip to content

CircleCI integration (abandoned due to memory limitations exceeded by steven_blocks) #174

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

Closed
wants to merge 17 commits into from
Closed
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
49 changes: 49 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: 2.1
executors:
docker:
parameters:
version:
type: string
default: 1.35.0
docker:
- image: circleci/rust:<< parameters.version >>
jobs:
build:
executor: docker
parameters:
release:
type: boolean
default: false
steps:
- install_deps
- checkout
- restore_cache:
keys:
- cargo-cache-v1-{{ arch }}-{{ checksum "./Cargo.lock" }}
- cargo-cache-v1-{{ arch }}
- run:
name: Build
no_output_timeout: 30m
command: |
rustc --version --verbose
cargo --version --verbose
if [ "<< parameters.release >>" == "true" ]; then
cargo build --release
cargo test --release
else
cargo build
cargo test
fi
- save_cache:
key: cargo-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "./Cargo.lock" }}
paths:
- ./target
commands:
install_deps:
steps:
- run:
name: Install deps
command: |
sudo apt-get update -qq
sudo apt-get install -y libegl1-mesa-dev libgles2-mesa-dev

82 changes: 41 additions & 41 deletions blocks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ macro_rules! define_blocks {
(
$(
$name:ident {
$(modid $modid:expr,)*
$(modid $modid:expr,)?
props {
$(
$fname:ident : $ftype:ty = [$($val:expr),+],
)*
},
$(data $datafunc:expr,)*
$(offset $offsetfunc:expr,)*
$(material $mat:expr,)*
$(data $datafunc:expr,)?
$(offset $offsetfunc:expr,)?
$(material $mat:expr,)?
model $model:expr,
$(variant $variant:expr,)*
$(tint $tint:expr,)*
$(collision $collision:expr,)*
$(update_state ($world:ident, $pos:ident) => $update_state:expr,)*
$(multipart ($mkey:ident, $mval:ident) => $multipart:expr,)*
$(variant $variant:expr,)?
$(tint $tint:expr,)?
$(collision $collision:expr,)?
$(update_state ($world:ident, $pos:ident) => $update_state:expr,)?
$(multipart ($mkey:ident, $mval:ident) => $multipart:expr,)?
}
)+
) => (
Expand All @@ -76,7 +76,7 @@ macro_rules! define_blocks {
$name {
$(
$fname : $ftype,
)*
)?
},
)+
}
Expand All @@ -90,7 +90,7 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
internal_ids::$name
}
Expand All @@ -103,12 +103,12 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
$(
let data: Option<usize> = ($datafunc).map(|v| v);
return data;
)*
)?
Some(0)
}
)+
Expand All @@ -120,16 +120,16 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
$(
let offset: Option<usize> = ($offsetfunc).map(|v| v);
return offset;
)*
)?
$(
let data: Option<usize> = ($datafunc).map(|v| v);
return data;
)*
)?
Some(0)
}
)+
Expand All @@ -141,11 +141,11 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
$(
return Some($modid);
)*
)?
None
}
)+
Expand Down Expand Up @@ -181,9 +181,9 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
$(return $mat;)*
$(return $mat;)?
material::SOLID
}
)+
Expand All @@ -195,7 +195,7 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
let parts = $model;
(String::from(parts.0), String::from(parts.1))
Expand All @@ -209,9 +209,9 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
$(return String::from($variant);)*
$(return String::from($variant);)?
"normal".to_owned()
}
)+
Expand All @@ -223,9 +223,9 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
$(return $tint;)*
$(return $tint;)?
TintType::Default
}
)+
Expand All @@ -237,9 +237,9 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
$(return $collision;)*
$(return $collision;)?
vec![Aabb3::new(
Point3::new(0.0, 0.0, 0.0),
Point3::new(1.0, 1.0, 1.0)
Expand All @@ -254,15 +254,15 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
$(
let $world = world;
let $pos = pos;
return $update_state;
)*
)?
Block::$name {
$($fname: $fname,)*
$($fname: $fname,)?
}
}
)+
Expand All @@ -274,13 +274,13 @@ macro_rules! define_blocks {
match *self {
$(
Block::$name {
$($fname,)*
$($fname,)?
} => {
$(
let $mkey = key;
let $mval = val;
return $multipart;
)*
)?
false
}
)+
Expand All @@ -307,15 +307,15 @@ macro_rules! define_blocks {
}
#[allow(non_camel_case_types)]
struct CombinationIterState<$($fname),*> {
$($fname: $fname,)*
$($fname: $fname,)?
}
#[allow(non_camel_case_types)]
struct CombinationIterOrig<$($fname),*> {
$($fname: $fname,)*
$($fname: $fname,)?
}
#[allow(non_camel_case_types)]
struct CombinationIterCurrent {
$($fname: $ftype,)*
$($fname: $ftype,)?
}

#[allow(non_camel_case_types)]
Expand All @@ -332,7 +332,7 @@ macro_rules! define_blocks {
return Some(Block::$name {
$(
$fname: self.current.$fname,
)*
)?
});
}
let mut has_value = false;
Expand All @@ -345,15 +345,15 @@ macro_rules! define_blocks {
}
self.state.$fname = self.orig.$fname.clone();
self.current.$fname = self.state.$fname.next().unwrap();
)*
)?
self.finished = true;
return None;
}
if has_value {
Some(Block::$name {
$(
$fname: self.current.$fname,
)*
)?
})
} else {
None
Expand All @@ -368,13 +368,13 @@ macro_rules! define_blocks {
finished: false,
first: true,
orig: CombinationIterOrig {
$($fname: $fname.clone(),)*
$($fname: $fname.clone(),)?
},
current: CombinationIterCurrent {
$($fname: $fname.next().unwrap(),)*
$($fname: $fname.next().unwrap(),)?
},
state: CombinationIterState {
$($fname: $fname,)*
$($fname: $fname,)?
}
}
}
Expand Down