Skip to content

Merge pull request #8 from KodeSage/dev #27

Merge pull request #8 from KodeSage/dev

Merge pull request #8 from KodeSage/dev #27

Workflow file for this run

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