Skip to content

Commit 7a7ca90

Browse files
rob1997kantagara
andauthored
Sample Tests via Foundry-Anvil (#1208)
* anvil working/integrated but tests still failing * working sample tests * some cleanup and refactor * checkpoint * checkpoint * moved some dependencies down * fixed async issue * Gelato tests * documentation and cleanup * updated workflow to use foundry * submodules update on checkout * trigger on push * log exceptions for initialize * dependencies * 172.17.0.1 * allowing http * dependable dependencies and verbose connection error exception * added --host 0.0.0.0 to anvil * reverted dependencies and push trigger * start and use anvil when in windows * remove pdb meta files * added events service adapter to Web3Unity_Tests.prefab * resolve conflict * merge fixed * small edit * requested changes made * Duplicated Samples [skip ci] * Sync Dependencies - Auto Commit --------- Co-authored-by: rob1997 <rob1997@users.noreply.github.com> Co-authored-by: Nikola Garabandic <kantagara@gmail.com>
1 parent f2fb23c commit 7a7ca90

File tree

218 files changed

+2096
-8065
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+2096
-8065
lines changed

.github/workflows/setup.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ jobs:
2727
ref: ${{ github.head_ref || github.ref_name }}
2828
lfs: true
2929
ssh-key: ${{ secrets.DEPLOY_KEY }}
30-
- name: update submodules
31-
run: |
32-
git submodule update --init
33-
shell: bash
30+
submodules: recursive
3431
- name: Setup .NET
3532
uses: actions/setup-dotnet@v3
3633
with:

.github/workflows/unity_tests.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: Unity Tests
1+
name: Unity Tests 🧪
22

33
on:
44
workflow_call:
5-
workflow_dispatch:
5+
workflow_dispatch:
66

77
jobs:
88
unity_tests:
@@ -19,10 +19,12 @@ jobs:
1919
- uses: actions/checkout@v4
2020
with:
2121
lfs: true
22-
- name: update submodules
22+
submodules: recursive
23+
- name: Install Foundry
24+
uses: foundry-rs/foundry-toolchain@v1
25+
- name: Start Anvil
2326
run: |
24-
git submodule update --init
25-
shell: bash
27+
anvil --host 0.0.0.0 --fork-url https://rpc.ankr.com/eth_sepolia --mnemonic "test test test test test test test test test test test junk" &
2628
- uses: actions/cache@v2
2729
with:
2830
path: ${{ matrix.projectPath }}/Library
Binary file not shown.
Binary file not shown.

Packages/io.chainsafe.web3-unity/Editor/ConnectionHandlerEditor.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using ChainSafe.Gaming.UnityPackage.Connection;
66
using Newtonsoft.Json;
77
using UnityEditor;
8+
using UnityEditor.Compilation;
89
using UnityEngine;
910

1011
// Editor for adding and removing providers in an interactive way.
@@ -34,8 +35,15 @@ public struct Provider
3435

3536
private void OnEnable()
3637
{
38+
Assembly[] unityAssemblies = CompilationPipeline.GetAssemblies(AssembliesType.PlayerWithoutTestAssemblies);
39+
3740
AppDomain.CurrentDomain.GetAssemblies().ToList().ForEach(assembly =>
3841
{
42+
if (unityAssemblies.All(a => assembly.GetName().Name != a.name))
43+
{
44+
return;
45+
}
46+
3947
_providerTypes.AddRange(assembly.GetTypes().Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(ConnectionProvider))));
4048
});
4149

Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)