From 16c2aea1dff752f57e8d723a54ff747135a9f8f6 Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Thu, 11 Jul 2024 23:55:56 -0400 Subject: [PATCH 1/9] Add automatic build for Build_tool when sourcing Export.sh --- Export.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Export.sh b/Export.sh index 8dba4e7..a4c6c21 100644 --- a/Export.sh +++ b/Export.sh @@ -4,15 +4,22 @@ Build_tool_directory=$(realpath "Build_tool") Build_tool_executable=$Build_tool_directory/target/release/Build_tool +# Check if the 'Build_tool' directory exists if [ ! -d "$Build_tool_directory" ]; then echo "The 'Build_tool' directory does not exist. Are you in the root of the repository?" exit 1 fi -if [ ! -f "$Build_tool_executable" ]; then - echo "The 'Build_tool' executable does not exist. Did you build the project? (Run 'cargo build --release')" + +( +# Build the build tool +cd $Build_tool_directory && cargo build --release + +if [ $? -ne 0 ]; then + echo "Failed to build the build tool" exit 1 fi +) clear && echo "Export xila build tool" From 781a59987dc13016cf97e184fa8f7f0827c5c82e Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Fri, 12 Jul 2024 00:05:39 -0400 Subject: [PATCH 2/9] Try to fix CI --- .github/workflows/rust_ci.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rust_ci.yml b/.github/workflows/rust_ci.yml index 8a98be8..480d8da 100644 --- a/.github/workflows/rust_ci.yml +++ b/.github/workflows/rust_ci.yml @@ -1,4 +1,4 @@ -name: Continuous Integration +name: Continuous integration on: push: @@ -13,19 +13,24 @@ env: jobs: rust-checks: - name: Rust Checks + name: Rust checks runs-on: ubuntu-latest strategy: fail-fast: false matrix: action: - - command: build - args: --release - - command: fmt + - command: format args: --all -- --check --color always - command: clippy args: --all-targets --all-features --workspace -- -D warnings + - command: build + args: --release - command: test + args: -- --include-ignored + target: + - linux + - esp32 + - esp32s3 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -35,7 +40,9 @@ jobs: uses: esp-rs/xtensa-toolchain@v1.5 with: default: true - buildtargets: esp32s3 + buildtargets: ${{ matrix.target }} ldproxy: true + - name: Build and enable build tool + run: source Export.sh - name: Run command - run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }} + run: xila ${{ matrix.action.command }} ${{ matrix.target }} ${{ matrix.action.args }} From c0857ae6b7ed54d8539283cab1ffb176ef00636b Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Fri, 12 Jul 2024 00:13:07 -0400 Subject: [PATCH 3/9] Try to fix CI --- .github/workflows/rust_ci.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust_ci.yml b/.github/workflows/rust_ci.yml index 480d8da..3cd8185 100644 --- a/.github/workflows/rust_ci.yml +++ b/.github/workflows/rust_ci.yml @@ -21,28 +21,44 @@ jobs: action: - command: format args: --all -- --check --color always + - command: clippy args: --all-targets --all-features --workspace -- -D warnings + - command: build args: --release + - command: test args: -- --include-ignored + target: - linux - esp32 - esp32s3 + steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Enable caching uses: Swatinem/rust-cache@v2 - - name: Setup Rust + with: + key: "${{ matrix.target }}" + + - name: Setup stable rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - name: Setup ESP rust toolchain uses: esp-rs/xtensa-toolchain@v1.5 with: default: true - buildtargets: ${{ matrix.target }} + buildtargets: esp32,esp32s3 ldproxy: true + - name: Build and enable build tool run: source Export.sh + - name: Run command run: xila ${{ matrix.action.command }} ${{ matrix.target }} ${{ matrix.action.args }} From 299680f2202adc229d24adb8045eb65a2aa9778c Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Fri, 12 Jul 2024 00:18:39 -0400 Subject: [PATCH 4/9] Try to fix CI --- .github/workflows/rust_ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust_ci.yml b/.github/workflows/rust_ci.yml index 3cd8185..9a9e8aa 100644 --- a/.github/workflows/rust_ci.yml +++ b/.github/workflows/rust_ci.yml @@ -11,6 +11,7 @@ env: CARGO_TERM_COLOR: always GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + jobs: rust-checks: name: Rust checks @@ -29,8 +30,8 @@ jobs: args: --release - command: test - args: -- --include-ignored - + args: --all -- --include-ignored + target: - linux - esp32 @@ -61,4 +62,4 @@ jobs: run: source Export.sh - name: Run command - run: xila ${{ matrix.action.command }} ${{ matrix.target }} ${{ matrix.action.args }} + run: Build_tool/target/release/Build_tool ${{ matrix.action.command }} ${{ matrix.target }} ${{ matrix.action.args }} From 6391eea1cc28d41f994656c29603487ca3a70240 Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Fri, 12 Jul 2024 00:23:39 -0400 Subject: [PATCH 5/9] Try to fix CI --- .github/workflows/rust_ci.yml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust_ci.yml b/.github/workflows/rust_ci.yml index 9a9e8aa..37e59be 100644 --- a/.github/workflows/rust_ci.yml +++ b/.github/workflows/rust_ci.yml @@ -19,19 +19,6 @@ jobs: strategy: fail-fast: false matrix: - action: - - command: format - args: --all -- --check --color always - - - command: clippy - args: --all-targets --all-features --workspace -- -D warnings - - - command: build - args: --release - - - command: test - args: --all -- --include-ignored - target: - linux - esp32 @@ -61,5 +48,11 @@ jobs: - name: Build and enable build tool run: source Export.sh - - name: Run command - run: Build_tool/target/release/Build_tool ${{ matrix.action.command }} ${{ matrix.target }} ${{ matrix.action.args }} + - name: Check formatting + run: Build_tool/target/release/Build_tool format --all -- --check --color always + + - name: Check clippy + run: Build_tool/target/release/Build_tool clippy ${{ matrix.target }} --all-features --workspace -- -D warnings + + - name: Run tests + run: Build_tool/target/release/Build_tool test ${{ matrix.target }} --all -- --include-ignored From c6af3861932cd38c4bbf0b465a351c0616e56793 Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Fri, 12 Jul 2024 00:27:22 -0400 Subject: [PATCH 6/9] Use binding tool from git repository --- Modules/Bindings/Cargo.toml | 5 +++-- Modules/Bindings/Tests/WASM_test/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Modules/Bindings/Cargo.toml b/Modules/Bindings/Cargo.toml index 31e0651..99181aa 100644 --- a/Modules/Bindings/Cargo.toml +++ b/Modules/Bindings/Cargo.toml @@ -7,7 +7,9 @@ build = "Build.rs" [dependencies] File_system = { path = "../File_system" } Virtual_machine = { path = "../Virtual_machine" } -Binding_tool = { path = "../../../Binding_tool", features = ["Native"] } +Binding_tool = { git = "https://github.com/Xila-Project/Binding_tool.git", features = [ + "Native", +] } Shared = { path = "../Shared" } Users = { path = "../Users" } Task = { path = "../Task" } @@ -28,4 +30,3 @@ path = "Tests/Task.rs" # [[test]] # name = "Graphics_bindings_tests" # path = "Tests/Graphics.rs" - diff --git a/Modules/Bindings/Tests/WASM_test/Cargo.toml b/Modules/Bindings/Tests/WASM_test/Cargo.toml index e1abe5e..63c6f45 100644 --- a/Modules/Bindings/Tests/WASM_test/Cargo.toml +++ b/Modules/Bindings/Tests/WASM_test/Cargo.toml @@ -10,4 +10,4 @@ opt-level = 's' strip = true [dependencies] -Binding_tool = { path = "../../../../../Binding_tool", features = ["WASM"] } +Binding_tool = { git = "https://github.com/Xila-Project/Binding_tool.git", features = ["WASM"] } From 101d36f6335fe45c25dcb37601654fe7cc4ba2e4 Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Fri, 12 Jul 2024 00:31:23 -0400 Subject: [PATCH 7/9] Add wasm target to rust toolchain --- .github/workflows/rust_ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust_ci.yml b/.github/workflows/rust_ci.yml index 37e59be..8f172dc 100644 --- a/.github/workflows/rust_ci.yml +++ b/.github/workflows/rust_ci.yml @@ -37,6 +37,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy + target: wasm32-unknown-unknown - name: Setup ESP rust toolchain uses: esp-rs/xtensa-toolchain@v1.5 From 578e15ce4286966dc2ce6760209d04a0a1c30fb7 Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Fri, 12 Jul 2024 00:33:42 -0400 Subject: [PATCH 8/9] Add sdl2 to dependencies --- .github/workflows/rust_ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust_ci.yml b/.github/workflows/rust_ci.yml index 8f172dc..9d1b472 100644 --- a/.github/workflows/rust_ci.yml +++ b/.github/workflows/rust_ci.yml @@ -45,6 +45,9 @@ jobs: default: true buildtargets: esp32,esp32s3 ldproxy: true + + -name: Install necessary dependencies + run: sudo apt-get install -y libsdl2-dev - name: Build and enable build tool run: source Export.sh From ccb952dbac30d28efb457602325e60c4eb09b7b0 Mon Sep 17 00:00:00 2001 From: Alix ANNERAUD Date: Fri, 12 Jul 2024 00:34:04 -0400 Subject: [PATCH 9/9] Fix typo --- .github/workflows/rust_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust_ci.yml b/.github/workflows/rust_ci.yml index 9d1b472..13a22d2 100644 --- a/.github/workflows/rust_ci.yml +++ b/.github/workflows/rust_ci.yml @@ -46,7 +46,7 @@ jobs: buildtargets: esp32,esp32s3 ldproxy: true - -name: Install necessary dependencies + - name: Install necessary dependencies run: sudo apt-get install -y libsdl2-dev - name: Build and enable build tool