Skip to content

Commit

Permalink
Merge pull request #24 from Xila-Project/Continuous_integration
Browse files Browse the repository at this point in the history
Continuous integration
  • Loading branch information
AlixANNERAUD authored Jul 12, 2024
2 parents 8083cb2 + ccb952d commit 1a109b8
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 19 deletions.
49 changes: 35 additions & 14 deletions .github/workflows/rust_ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Continuous Integration
name: Continuous integration

on:
push:
Expand All @@ -11,31 +11,52 @@ env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}


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
args: --all -- --check --color always
- command: clippy
args: --all-targets --all-features --workspace -- -D warnings
- command: test
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
target: wasm32-unknown-unknown

- name: Setup ESP rust toolchain
uses: esp-rs/[email protected]
with:
default: true
buildtargets: esp32s3
buildtargets: esp32,esp32s3
ldproxy: true
- name: Run command
run: cargo ${{ matrix.action.command }} ${{ matrix.action.args }}

- name: Install necessary dependencies
run: sudo apt-get install -y libsdl2-dev

- name: Build and enable build tool
run: source Export.sh

- 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
11 changes: 9 additions & 2 deletions Export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
5 changes: 3 additions & 2 deletions Modules/Bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand All @@ -28,4 +30,3 @@ path = "Tests/Task.rs"
# [[test]]
# name = "Graphics_bindings_tests"
# path = "Tests/Graphics.rs"

2 changes: 1 addition & 1 deletion Modules/Bindings/Tests/WASM_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }

0 comments on commit 1a109b8

Please sign in to comment.