Skip to content

Commit

Permalink
ci: improve speeds (#644)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgazelka authored Dec 4, 2024
1 parent df5f045 commit 62d08bf
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 86 deletions.
121 changes: 59 additions & 62 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ jobs:
run: |
cargo machete
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Run cargo test
run: |
cargo test --workspace --all-features
# test:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - uses: actions-rust-lang/setup-rust-toolchain@v1
# with:
# toolchain: ${{ env.RUST_TOOLCHAIN }}
#
# - uses: Swatinem/rust-cache@v2
# with:
# cache-on-failure: true
#
# - name: Run cargo test
# run: |
# cargo test --workspace --all-features

fmt:
runs-on: ubuntu-latest
Expand All @@ -55,7 +55,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
toolchain: ${{ env.RUST_TOOLCHAIN }}
Expand All @@ -64,25 +64,25 @@ jobs:
run: |
cargo fmt --all -- --check
docs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Run cargo doc
run: |
cargo doc --workspace --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
# docs:
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - uses: actions-rust-lang/setup-rust-toolchain@v1
# with:
# toolchain: ${{ env.RUST_TOOLCHAIN }}
#
# - uses: Swatinem/rust-cache@v2
# with:
# cache-on-failure: true
# - name: Run cargo doc
# run: |
# cargo doc --workspace --no-deps --all-features
# env:
# RUSTDOCFLAGS: -D warnings

clippy:
runs-on: ubuntu-latest
Expand All @@ -92,35 +92,32 @@ jobs:
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Clippy check
run: cargo clippy --workspace --benches --tests --examples --all-features -- -D warnings

check:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Cargo check
run: cargo check --workspace --all-features
# check:
# strategy:
# matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
# runs-on: ${{ matrix.os }}
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# - name: Setup Rust toolchain
# uses: actions-rust-lang/setup-rust-toolchain@v1
# with:
# toolchain: ${{ env.RUST_TOOLCHAIN }}
#
# - uses: Swatinem/rust-cache@v2
# with:
# cache-on-failure: true
#
# - name: Cargo check
# run: cargo check --workspace --all-features
11 changes: 0 additions & 11 deletions Cargo.lock

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

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ git = 'https://github.com/Indra-db/Flecs-Rust'
[workspace.dependencies.geometry]
path = 'crates/geometry'

[workspace.dependencies.gxhash]
version = '3.4.1'

[workspace.dependencies.hyperion]
path = 'crates/hyperion'

Expand Down
1 change: 0 additions & 1 deletion crates/hyperion-command/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ publish = false

[dependencies]
flecs_ecs = { workspace = true }
gxhash = { workspace = true }
hyperion = { workspace = true }
indexmap = { workspace = true }
tracing = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/hyperion-command/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub struct CommandHandler {

#[derive(Component)]
pub struct CommandRegistry {
pub(crate) commands: IndexMap<String, CommandHandler, gxhash::GxBuildHasher>,
pub(crate) commands: IndexMap<String, CommandHandler>,
}

impl CommandRegistry {
Expand Down
1 change: 0 additions & 1 deletion events/tag/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ tracing-subscriber = { workspace = true }
tracing-tracy = { workspace = true }
tracing = { workspace = true }
rayon = { workspace = true }
gxhash = { workspace = true }
derive_more = { workspace = true }
geometry = { workspace = true }
uuid = { version = "1.11.0", features = ["v4"] }
Expand Down
7 changes: 3 additions & 4 deletions events/tag/src/command/replace.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::collections::{HashSet, VecDeque};

use flecs_ecs::core::{Entity, EntityViewGet, World, WorldGet};
use gxhash::GxBuildHasher;
use hyperion::{BlockState, glam::IVec3, simulation::blocks::Blocks};
use hyperion_clap::CommandPermission;
use rayon::iter::ParallelIterator;
Expand Down Expand Up @@ -65,8 +64,8 @@ const ADJACENT: [IVec3; 6] = [

/// Groups connected positions in 3D space
/// Returns a vector of groups, where each group is a vector of connected positions
fn group(positions: &HashSet<IVec3, GxBuildHasher>) -> Vec<Vec<IVec3>> {
let mut visited: HashSet<IVec3, GxBuildHasher> = HashSet::default();
fn group(positions: &HashSet<IVec3>) -> Vec<Vec<IVec3>> {
let mut visited: HashSet<IVec3> = HashSet::default();
let mut groups: Vec<Vec<IVec3>> = Vec::new();

// Iterate through all positions
Expand Down Expand Up @@ -111,7 +110,7 @@ impl hyperion_clap::MinecraftCommand for ReplaceCommand {
world.get::<&mut Blocks>(|blocks| {
let started_time = std::time::Instant::now();

let concrete_positions: HashSet<_, GxBuildHasher> =
let concrete_positions: HashSet<_> =
blocks.par_scan_for(BlockState::PINK_CONCRETE).collect();

let scan_time = started_time.elapsed();
Expand Down
4 changes: 2 additions & 2 deletions events/tag/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#![feature(iter_from_coroutine)]
#![feature(exact_size_is_empty)]

use std::net::ToSocketAddrs;
use std::{collections::HashSet, net::ToSocketAddrs};

use flecs_ecs::prelude::*;
use hyperion::{
Expand Down Expand Up @@ -41,7 +41,7 @@ mod skin;

#[derive(Component, Default, Deref, DerefMut)]
struct OreVeins {
ores: gxhash::HashSet<IVec3>,
ores: HashSet<IVec3>,
}

#[derive(Component, Deref, DerefMut)]
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2024-11-29"
components = ["rustfmt", "clippy", "rustc-codegen-cranelift-preview"]
components = ["rustfmt", "clippy"]
profile = "minimal"

0 comments on commit 62d08bf

Please sign in to comment.