Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create rust.yml #28

Merged
merged 1 commit into from
Oct 26, 2024
Merged
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 suggestion (security): Consider adding RUSTFLAGS with additional security checks for CI builds

Adding RUSTFLAGS='-D warnings' will ensure CI fails on any warnings, helping catch potential issues early. You might also want to consider adding other security-related flags.

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings -D unsafe-code"

CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (performance): Consider adding cargo dependency caching to improve build performance

You can use actions/cache to cache ~/.cargo and target/ directories. This will significantly speed up your CI pipeline by reusing previously downloaded dependencies.

    steps:
    - uses: actions/cache@v3
      with:
        path: |
          ~/.cargo/registry
          ~/.cargo/git
          target
        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
    - uses: actions/checkout@v4
    - name: Build

- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
Loading