Skip to content

Commit

Permalink
Merge branch 'main' into season_alpha_ctf_basic_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemadden committed Dec 24, 2024
2 parents 20b7628 + 0a2938d commit 3e10b26
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 154 deletions.
118 changes: 16 additions & 102 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,111 +1,25 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/msrv.md

on: [push, pull_request]

name: Test
name: check

jobs:
check:
name: Check
stable:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- nightly
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
continue-on-error: false
with:
command: check

test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- nightly
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Run cargo test
uses: actions-rs/cargo@v1
continue-on-error: false
with:
command: test

fmt:
name: Rustfmt
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- run: cargo fmt --all -- --check
- run: cargo clippy --all-features -- -D warnings
- run: cargo test --all-features
nightly:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- nightly
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Install rustfmt
run: rustup component add rustfmt

- name: Run cargo fmt
uses: actions-rs/cargo@v1
continue-on-error: false
with:
command: fmt
args: --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
# temporarily disabled due to https://github.com/rust-lang/rust-clippy/issues/12377
#- nightly
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true

- name: Install clippy
run: rustup component add clippy

- name: Run cargo clippy
uses: actions-rs/cargo@v1
continue-on-error: false
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
command: clippy
args: -- -D warnings
components: clippy, rustfmt
- run: cargo fmt --all -- --check
- run: cargo clippy --all-features -- -D warnings
- run: cargo test --all-features
49 changes: 0 additions & 49 deletions src/constants/extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,12 @@
/// site is destroyed by being stepped on by a hostile creep.
pub const CONSTRUCTION_SITE_STOMP_RATIO: f32 = 0.5;

/// Maximum length of signs on controllers.
//pub const CONTROLLER_SIGN_MAX_LENGTH: u32 = 100;

/// Maximum amount of CPU that can be accumulated in your bucket per shard.
//pub const CPU_BUCKET_MAX: u32 = 10_000;

/// Maximum value of [`CpuInfo::tick_limit`] if more bucket is available than
/// can be used this tick.
///
/// [`CpuInfo::tick_limit`]: crate::game::cpu::CpuInfo::tick_limit
//pub const CPU_TICK_LIMIT_MAX: u32 = 500;

/// Hits per creep body part.
pub const CREEP_HITS_PER_PART: u32 = 100;

/// Maximum length of names of creeps.
//pub const CREEP_NAME_MAX_LENGTH: u32 = 100;

/// Maximum length of names of flag objects.
//pub const FLAG_NAME_MAX_LENGTH: u32 = 60;

/// Maximum size in bytes (100 KiB) of the string contents allowed for inter
/// shard memory.
//pub const INTER_SHARD_MEMORY_SIZE_LIMIT: u32 = 100 * 1024;

/// Owner username of hostile non-player structures and creeps which create
/// strongholds and spawn in rooms due to energy harvesting.
//pub const INVADER_USERNAME: &str = "Invader";

/// Maximum range from a lab to the input or output labs it's interacting with.
//pub const LAB_REACTION_RANGE: u32 = 2;

/// The maximum size (1000 KiB) of the serialized [`MapVisual`] data.
//pub const MAP_VISUAL_SIZE_LIMIT: u32 = 1000 * 1024;

/// The maximum number of times that you can deal on market orders in a single
/// tick.
//pub const MARKET_MAX_DEALS_PER_TICK: u32 = 10;

/// Maximum size in bytes (100 KiB) of the string contents allowed in memory
/// segments.
//pub const MEMORY_SEGMENT_SIZE_LIMIT: u32 = 100 * 1024;

/// Maximum size in bytes (2 MiB) of the string contents allowed in memory.
//pub const MEMORY_SIZE_LIMIT: u32 = 2 * 1024 * 1024;

/// Fatigue points removed per effective move part per tick.
pub const MOVE_POWER: u32 = 2;

/// Maximum hits of a power creep per level.
//pub const POWER_CREEP_HITS_PER_LEVEL: u32 = 1000;

/// Maximum length of names of power creeps.
//pub const POWER_CREEP_NAME_MAX_LENGTH: u32 = 100;

/// Hits of damage per effective ranged attack part per
/// [`Creep::ranged_mass_attack`] action at range 1.
///
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
// to build locally with doc_cfg enabled, run:
// `RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features`
#![cfg_attr(docsrs, feature(doc_cfg))]
// temporary workaround for https://github.com/rust-lang/rust-clippy/issues/12377
// fix not being in current stable rust 1.78; should be fixed in 1.79
#![allow(clippy::empty_docs)]
// disable deprecation warnings - TODO need to figure out how to get wasm_bindgen's new thread_local
// attribute working
#![allow(deprecated)]

pub mod constants;
pub mod enums;
Expand Down

0 comments on commit 3e10b26

Please sign in to comment.