poprawione readme
#4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust CI & Build | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| # Pozwala uruchomić ręcznie z zakładki Actions | |
| workflow_dispatch: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-and-test: | |
| name: Build on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # Testujemy na Windows (Twoje środowisko) i Ubuntu (dla pewności) | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update Rust Toolchain | |
| run: rustup update stable && rustup default stable | |
| - name: Install Linux Dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libx11-dev libssl-dev | |
| # Cache przyspiesza budowanie przy kolejnych uruchomieniach | |
| - name: Cache Cargo | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| # 1. Sprawdzanie formatowania (czy użyłeś cargo fmt) | |
| - name: Check Formatting | |
| run: cargo fmt -- --check | |
| # 2. Sprawdzanie jakości kodu (Linter Clippy) | |
| - name: Lint with Clippy | |
| run: cargo clippy -- -D warnings | |
| # 3. Uruchomienie testów | |
| - name: Run tests | |
| run: cargo test --verbose | |
| # 4. Budowanie wersji produkcyjnej (Release) | |
| - name: Build Release | |
| run: cargo build --release --verbose | |
| # 5. Wyciągnięcie gotowego pliku .exe (Tylko dla Windows) | |
| - name: Upload Windows Artifact | |
| if: runner.os == 'Windows' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cargo-plot-fs-tree-windows | |
| path: target/release/cargo-plot-fs-tree.exe | |
| # 6. Wyciągnięcie gotowego pliku binarnego (Tylko dla Linux) | |
| - name: Upload Linux Artifact | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cargo-plot-fs-tree-linux | |
| path: target/release/cargo-plot-fs-tree |