Swoorup / wgsl-bindgen

Generate typesafe Rust bindings for wgsl shaders in wgpu
https://crates.io/crates/wgsl_bindgen
MIT License
33 stars 6 forks source link

Create rust.yml #2

Open Swoorup opened 7 months ago

Swoorup commented 7 months ago

Stabilization is not that far of: https://github.com/rust-lang/rust/issues/106655#issuecomment-1902272292 Probably hold this off until then...

Swoorup commented 4 months ago

@gooroo-dev review

gooroo-dev[bot] commented 4 months ago

It looks like the git PR diff content was not included in your request. Please provide the diff or the relevant code changes so that I can review them and provide the required feedback.

Yours, Gooroo.dev

ghost commented 4 months ago

@gooroo-dev review

gooroo-dev[bot] commented 4 months ago

No known files to review.

ghost commented 4 months ago

@gooroo-dev review

gooroo-dev[bot] commented 4 months ago

I couldn't find any files for me to review. At this moment, I support these file extensions: .js, .jsx, .ts, .coffee, .rb, .cpp, .cc, .cxx, .c, .h, .hpp, .py, .php, .java, .go, .cs, .kt, .kts, .swift, .css, .scss, .sass, .erb, .less, .sass, .rs, .kts.

ghost commented 4 months ago

@gooroo-dev review anyway

gooroo-dev[bot] commented 4 months ago

I couldn't find any files for me to review. At this moment, I support these file extensions: .js, .jsx, .ts, .coffee, .rb, .cpp, .cc, .cxx, .c, .h, .hpp, .py, .php, .java, .go, .cs, .kt, .kts, .swift, .css, .scss, .sass, .erb, .less, .sass, .rs, .kts.

gooroo-dev[bot] commented 4 months ago

Summary of Changes

Issues, Bugs, or Typos

Suggestions for Improvement

  1. Cache Dependencies: To speed up the build process, you can cache the Cargo dependencies. This can be done by adding a step to cache the Cargo registry and build artifacts:

    - name: Cache Cargo registry
     uses: actions/cache@v2
     with:
       path: ~/.cargo/registry
       key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
       restore-keys: |
         ${{ runner.os }}-cargo-registry-
    
    - name: Cache Cargo build
     uses: actions/cache@v2
     with:
       path: target
       key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
       restore-keys: |
         ${{ runner.os }}-cargo-build-
  2. Add Linting: It's a good practice to add a linting step to ensure code quality. You can use cargo clippy for this purpose:

    - name: Run linter
     run: cargo clippy --all-targets --all-features -- -D warnings
  3. Separate Build and Test Jobs: For better organization and potential parallelism, you can separate the build and test steps into different jobs:

    jobs:
     build:
       runs-on: ubuntu-latest
       steps:
       - uses: actions/checkout@v3
       - name: Cache Cargo registry
         uses: actions/cache@v2
         with:
           path: ~/.cargo/registry
           key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
           restore-keys: |
             ${{ runner.os }}-cargo-registry-
       - name: Cache Cargo build
         uses: actions/cache@v2
         with:
           path: target
           key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
           restore-keys: |
             ${{ runner.os }}-cargo-build-
       - name: Build
         run: cargo build --verbose
    
     test:
       runs-on: ubuntu-latest
       needs: build
       steps:
       - uses: actions/checkout@v3
       - name: Run tests
         run: cargo test --verbose

These improvements can help optimize the CI process and ensure better code quality.

Yours, Gooroo.dev