Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
58163f5
check if it is working
JunkyDeveloper Feb 12, 2026
88603a4
now?
JunkyDeveloper Feb 12, 2026
9489fe6
now?
JunkyDeveloper Feb 12, 2026
0112a9a
Merge branch 'Steel-Foundation:master' into flint-cicd
JunkyDeveloper Feb 12, 2026
d79636d
now?
JunkyDeveloper Feb 12, 2026
8516e10
better?
JunkyDeveloper Feb 12, 2026
3adf5ef
theoretically now working
JunkyDeveloper Feb 12, 2026
f55aad6
new version
JunkyDeveloper Mar 11, 2026
53cfad4
Merge branch 'master' into flint-cicd
JunkyDeveloper Mar 11, 2026
b167557
let's see baseline should be created on main
JunkyDeveloper Mar 11, 2026
a3a776d
new version
JunkyDeveloper Mar 11, 2026
c40ba35
repair and new run
JunkyDeveloper Mar 11, 2026
b36cf68
Merge branch 'master' into flint-cicd
JunkyDeveloper Mar 12, 2026
0529273
hide flint stuff behind a feature
JunkyDeveloper Mar 17, 2026
117387c
Merge branch 'small_changes_for_flint' into flint-cicd
JunkyDeveloper Mar 17, 2026
8365378
clippy
JunkyDeveloper Mar 18, 2026
c439024
fix clippy better I hope
JunkyDeveloper Mar 18, 2026
2967eb7
Merge branch 'master' into flint-cicd
JunkyDeveloper Mar 19, 2026
127200e
add toml for flint
JunkyDeveloper Mar 21, 2026
21ce6a5
Merge branch 'master' into flint-cicd
JunkyDeveloper Mar 21, 2026
00c639f
clippy
JunkyDeveloper Mar 21, 2026
31669ab
clippy
JunkyDeveloper Mar 21, 2026
48953c3
wrong repo
JunkyDeveloper Mar 21, 2026
ce2976a
do selected
JunkyDeveloper Mar 21, 2026
d36585d
better name to have a rerun for ci
JunkyDeveloper Mar 23, 2026
9fd0ab8
Merge branch 'master' into flint-cicd
JunkyDeveloper Mar 23, 2026
1795971
use tagged version
JunkyDeveloper Mar 23, 2026
b01a396
Merge branch 'master' into flint-cicd
JunkyDeveloper Mar 25, 2026
afd0bd1
Merge branch 'master' into flint-cicd
4lve Mar 30, 2026
cc5e5a0
renamed tag
JunkyDeveloper Mar 30, 2026
1ee87d5
Merge remote-tracking branch 'origin/flint-cicd' into flint-cicd
JunkyDeveloper Mar 30, 2026
73f7b32
Merge branch 'master' into flint-cicd
JunkyDeveloper Apr 6, 2026
f867590
update to new flint-steel version
JunkyDeveloper Apr 6, 2026
9a7a724
Merge branch 'Steel-Foundation:master' into flint-cicd
JunkyDeveloper Apr 10, 2026
7b03c74
bump flint-steel version
JunkyDeveloper Apr 10, 2026
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
160 changes: 160 additions & 0 deletions .github/workflows/flint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
name: Flint Tests

on:
push:
branches: ['**']
tags: ['**']
pull_request:


env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout SteelMC
uses: actions/checkout@v4
with:
path: SteelMC

- name: Checkout flint-steel
uses: actions/checkout@v4
with:
repository: FlintTestMC/flint-steel
ref: v1.1.1
path: flint-steel

- name: Clone FlintBenchmark
uses: actions/checkout@v4
with:
repository: FlintTestMC/FlintBenchmark
path: FlintBenchmark

- name: Setup Rust nightly
uses: dtolnay/rust-toolchain@nightly

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: |
flint-steel -> target
shared-key: "flint-steel"
cache-on-failure: true
save-if: ${{ github.ref == 'refs/heads/master' || github.event_name == 'pull_request' }}

- name: Configure SteelMC patch for Flint
working-directory: flint-steel
run: |
mkdir -p .cargo
cat > .cargo/config.toml << 'EOF'
[patch."https://github.com/Steel-Foundation/SteelMC.git"]
steel-core = { path = "../SteelMC/steel-core", features = ["flint"] }
steel-protocol = { path = "../SteelMC/steel-protocol" }
steel-registry = { path = "../SteelMC/steel-registry" }
steel-utils = { path = "../SteelMC/steel-utils" }
EOF

- name: Configure Flint via toml
working-directory: flint-steel
run: |
cat > flint.toml << 'EOF'
[filter]
implemented_only = true

# [filter.tags]
# redstone = true
# walls = false
# fence = true

EOF

- name: Run flint-steel tests
id: tests
working-directory: flint-steel
continue-on-error: true
timeout-minutes: 15
env:
TEST_PATH: ${{ github.workspace }}/FlintBenchmark/tests
run: cargo test --profile cicd --lib test_run_flint_selected -- --nocapture

- name: Download baseline
id: baseline
uses: dawidd6/action-download-artifact@v6
continue-on-error: true
with:
name: flint-baseline
branch: master
workflow: flint.yml
path: baseline

- name: Check for regressions
id: regression
run: |
SUMMARY="flint-steel/log/flint_summary.json"
BASELINE="baseline/flint_baseline.json"

if [ ! -f "$SUMMARY" ]; then
echo "::error::No flint_summary.json produced — tests likely failed to compile"
exit 1
fi

if [ ! -f "$BASELINE" ]; then
echo "No baseline found — skipping regression check"
exit 0
fi

# Find tests that passed in baseline but fail now
REGRESSIONS=$(jq -n \
--slurpfile base "$BASELINE" \
--slurpfile curr "$SUMMARY" \
'($base[0] | map(select(.success == true)) | map(.name)) as $required |
[$curr[0][] | select(.success == false and IN(.name; $required[]))] |
map(.name)')

if [ "$REGRESSIONS" != "[]" ]; then
echo "::error::Regressions detected: $REGRESSIONS"
echo "$REGRESSIONS" | jq -r '.[]' | while read -r name; do
echo " - $name"
done
exit 1
fi

echo "No regressions detected"

- name: Merge and upload baseline
if: github.ref == 'refs/heads/master' && steps.regression.outcome == 'success'
run: |
SUMMARY="flint-steel/log/flint_summary.json"
BASELINE="baseline/flint_baseline.json"
MERGED="flint_baseline.json"

if [ -f "$BASELINE" ]; then
# Merge: old baseline successes ∪ current successes
jq -n \
--slurpfile base "$BASELINE" \
--slurpfile curr "$SUMMARY" \
'($base[0] + $curr[0]) | group_by(.name) | map({
name: .[0].name,
ids: .[-1].ids,
success: (map(.success) | any)
})' > "$MERGED"
else
# First run — current results become the baseline
cp "$SUMMARY" "$MERGED"
fi

- name: Upload baseline artifact
if: github.ref == 'refs/heads/master' && steps.regression.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: flint-baseline
path: flint_baseline.json

- name: Upload Flint summary
if: always()
uses: actions/upload-artifact@v4
with:
name: flint-summary
path: flint-steel/log/flint_summary.json
2 changes: 2 additions & 0 deletions steel-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ build = "build/build.rs"
#default = ["stand-alone"]
stand-alone = []
slow_chunk_gen = []
flint = []


[dependencies]
# Internal crates
Expand Down
15 changes: 15 additions & 0 deletions steel-core/src/behavior/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ pub struct PickupResult {
/// - Player interactions
/// - State changes
pub trait BlockBehavior: Send + Sync {
/// Returns the Rust type name of the concrete behavior implementation.
#[cfg(feature = "flint")]
#[must_use]
#[expect(clippy::absolute_paths, reason = "easier for features")]
fn type_name(&self) -> &'static str {
std::any::type_name::<Self>()
}

/// Called when a player uses an empty bucket on this block.
///
/// Should:
Expand Down Expand Up @@ -498,6 +506,13 @@ impl BlockBehaviorRegistry {
self.behaviors[id].as_ref()
}

/// Get all behaviors.
#[cfg(feature = "flint")]
#[must_use]
pub fn get_behaviors(&self) -> &[Box<dyn BlockBehavior>] {
&self.behaviors
}

/// Gets the behavior for a block by its ID.
#[must_use]
pub fn get_behavior_by_id(&self, id: usize) -> Option<&dyn BlockBehavior> {
Expand Down
15 changes: 15 additions & 0 deletions steel-core/src/behavior/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ use crate::behavior::{InteractionResult, UseItemContext, UseOnContext};
/// - Use in air
/// - etc.
pub trait ItemBehavior: Send + Sync {
/// Returns the Rust type name of the concrete behavior implementation.
#[cfg(feature = "flint")]
#[must_use]
#[expect(clippy::absolute_paths, reason = "easier for features")]
fn type_name(&self) -> &'static str {
std::any::type_name::<Self>()
}

/// Called when this item is used on a block.
fn use_on(&self, _context: &mut UseOnContext) -> InteractionResult {
InteractionResult::Pass
Expand Down Expand Up @@ -64,6 +72,13 @@ impl ItemBehaviorRegistry {
pub fn get_behavior_by_id(&self, id: usize) -> Option<&dyn ItemBehavior> {
self.behaviors.get(id).map(AsRef::as_ref)
}

/// Get all behaviors.
#[cfg(feature = "flint")]
#[must_use]
pub fn get_behaviors(&self) -> &[Box<dyn ItemBehavior>] {
&self.behaviors
}
}

impl Default for ItemBehaviorRegistry {
Expand Down
Loading