-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.1 KB
/
rust.yml
File metadata and controls
77 lines (64 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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