-
Notifications
You must be signed in to change notification settings - Fork 1
172 lines (137 loc) · 5.1 KB
/
ci.yml
File metadata and controls
172 lines (137 loc) · 5.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: CI
on:
push:
branches: [main, master, dev]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
# ── 1. Format + Lint ────────────────────────────────────────────────────────
lint:
name: Format & Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: cargo fmt --check
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings
# ── 2. Build ────────────────────────────────────────────────────────────────
build:
name: Build (${{ matrix.os }})
needs: lint
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: cargo build --release
run: cargo build --release
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: rustyochestrator-${{ runner.os }}
path: |
target/release/rustyochestrator
target/release/rustyochestrator.exe
# ── 3. Unit & Integration Tests ─────────────────────────────────────────────
test:
name: Tests
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run all tests
run: cargo test --all
- name: Run pipeline tests
run: cargo test --test pipeline_tests
- name: Run cache tests
run: cargo test --test cache_tests
- name: Run github tests
run: cargo test --test github_tests
- name: Run executor tests
run: cargo test --test executor_tests
- name: Run scheduler tests
run: cargo test --test scheduler_tests
- name: Run config tests
run: cargo test --test config_tests
- name: Run reporter tests
run: cargo test --test reporter_tests
- name: Run errors tests
run: cargo test --test errors_tests
- name: Run main.rs unit tests (parse_dotenv)
run: cargo test --bin rustyochestrator
# ── 4. Integration smoke test ───────────────────────────────────────────────
integration:
name: Integration smoke test
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run native pipeline
run: cargo run -- run examples/pipeline.yaml
- name: Run again (all tasks should be cache hits)
run: |
cargo run -- run examples/pipeline.yaml 2>&1 | tee /tmp/rustyochestrator_out.txt
grep -c "CACHE HIT" /tmp/rustyochestrator_out.txt | grep -q "^7$" \
&& echo "✓ all 7 tasks were cache hits" \
|| (echo "✗ expected 4 cache hits" && exit 1)
- name: Run GitHub Actions example (via rustyochestrator)
run: cargo run -- run examples/github_actions.yaml
- name: Validate pipeline without running
run: cargo run -- validate examples/pipeline.yaml
- name: List pipeline execution order
run: cargo run -- list examples/pipeline.yaml
- name: Print dependency graph
run: cargo run -- graph examples/pipeline.yaml
- name: Scaffold and validate a new pipeline
run: |
cargo run -- init /tmp/test_init_pipeline.yaml
cargo run -- validate /tmp/test_init_pipeline.yaml