Skip to content

Commit 8d27640

Browse files
committed
added ci
1 parent 7388951 commit 8d27640

32 files changed

+612
-100
lines changed

.github/workflows/build.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'src/**'
8+
- 'Cargo.toml'
9+
- 'Cargo.lock'
10+
- 'ci-scripts/**'
11+
- '.github/workflows/build.yml'
12+
pull_request:
13+
branches: [main]
14+
paths:
15+
- 'src/**'
16+
- 'Cargo.toml'
17+
- 'Cargo.lock'
18+
- 'ci-scripts/**'
19+
- '.github/workflows/build.yml'
20+
21+
jobs:
22+
build:
23+
name: Build and Test
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Install Rust toolchain
31+
uses: dtolnay/rust-toolchain@stable
32+
with:
33+
components: rustfmt, clippy
34+
35+
- name: Cache dependencies
36+
uses: Swatinem/rust-cache@v2
37+
38+
- name: Set executable permissions for CI scripts
39+
run: |
40+
chmod +x ci-scripts/format.sh
41+
chmod +x ci-scripts/lint.sh
42+
chmod +x ci-scripts/test.sh
43+
chmod +x ci-scripts/build.sh
44+
45+
- name: Format code
46+
run: ./ci-scripts/format.sh
47+
48+
- name: Run linter
49+
run: ./ci-scripts/lint.sh
50+
51+
- name: Run tests
52+
run: ./ci-scripts/test.sh
53+
54+
- name: Build release
55+
run: ./ci-scripts/build.sh
56+
57+
- name: Upload artifact
58+
uses: actions/upload-artifact@v3
59+
with:
60+
name: stackql-deploy
61+
path: target/release/stackql-deploy

.github/workflows/deploy-action.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Deploy GitHub Action
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'action/**'
8+
- 'action.yml'
9+
- '.github/workflows/deploy-action.yml'
10+
pull_request:
11+
branches: [main]
12+
paths:
13+
- 'action/**'
14+
- 'action.yml'
15+
- '.github/workflows/deploy-action.yml'
16+
17+
jobs:
18+
deploy-action:
19+
name: Deploy GitHub Action
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Placeholder deployment
24+
run: |
25+
echo "🚀 Deploying Action (placeholder)"
26+
echo "This is a placeholder step - actual implementation pending"
27+
28+
# - name: Checkout repository
29+
# uses: actions/checkout@v4
30+
# with:
31+
# fetch-depth: 0
32+
33+
# - name: Validate action.yml
34+
# run: |
35+
# if [ -f "action.yml" ]; then
36+
# echo "✅ action.yml found and valid"
37+
# else
38+
# echo "❌ action.yml not found or invalid"
39+
# exit 1
40+
# fi
41+
42+
# - name: Create tag if necessary
43+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
44+
# id: tag_version
45+
# uses: mathieudutour/[email protected]
46+
# with:
47+
# github_token: ${{ secrets.GITHUB_TOKEN }}
48+
# release_branches: main
49+
# tag_prefix: v
50+
51+
# - name: Create a GitHub release
52+
# if: steps.tag_version.outputs.new_tag
53+
# uses: ncipollo/release-action@v1
54+
# with:
55+
# tag: ${{ steps.tag_version.outputs.new_tag }}
56+
# name: Release ${{ steps.tag_version.outputs.new_tag }}
57+
# body: ${{ steps.tag_version.outputs.changelog }}

.github/workflows/deploy-website.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy Website
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'website/**'
8+
- '.github/workflows/deploy-website.yml'
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- 'website/**'
13+
- '.github/workflows/deploy-website.yml'
14+
15+
jobs:
16+
deploy-website:
17+
name: Build and Deploy Website
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Placeholder deployment
22+
run: |
23+
echo "🚀 Deploying Website (placeholder)"
24+
echo "This is a placeholder step - actual implementation pending"
25+
# - name: Checkout repository
26+
# uses: actions/checkout@v4
27+
28+
# - name: Setup Node.js
29+
# uses: actions/setup-node@v3
30+
# with:
31+
# node-version: '18'
32+
# cache: 'npm'
33+
# cache-dependency-path: 'website/package-lock.json'
34+
35+
# - name: Install dependencies
36+
# working-directory: website
37+
# run: npm ci
38+
39+
# - name: Build website
40+
# working-directory: website
41+
# run: npm run build
42+
43+
# - name: Deploy to GitHub Pages
44+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
45+
# uses: peaceiris/actions-gh-pages@v3
46+
# with:
47+
# github_token: ${{ secrets.GITHUB_TOKEN }}
48+
# publish_dir: website/build
49+
# cname: deploy.stackql.io # Replace with your domain if applicable

.github/workflows/test-demo.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Test Demo
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'demo/**'
8+
- '.github/workflows/test-demo.yml'
9+
pull_request:
10+
branches: [main]
11+
paths:
12+
- 'demo/**'
13+
- '.github/workflows/test-demo.yml'
14+
15+
jobs:
16+
test-demo:
17+
name: Test Demo Projects
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Placeholder deployment
22+
run: |
23+
echo "🚀 Testing Demos (placeholder)"
24+
echo "This is a placeholder step - actual implementation pending"
25+
# - name: Checkout repository
26+
# uses: actions/checkout@v4
27+
28+
# - name: Install Rust toolchain
29+
# uses: dtolnay/rust-toolchain@stable
30+
31+
# - name: Build CLI
32+
# run: cargo build --release
33+
34+
# - name: Configure AWS credentials
35+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
36+
# uses: aws-actions/configure-aws-credentials@v2
37+
# with:
38+
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
39+
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
40+
# aws-region: us-east-1
41+
42+
# - name: Configure Azure credentials
43+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
44+
# uses: azure/login@v1
45+
# with:
46+
# creds: ${{ secrets.AZURE_CREDENTIALS }}
47+
48+
# - name: Setup Google Cloud SDK
49+
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
50+
# uses: google-github-actions/setup-gcloud@v1
51+
# with:
52+
# service_account_key: ${{ secrets.GCP_SA_KEY }}
53+
# project_id: ${{ secrets.GCP_PROJECT_ID }}
54+
55+
# - name: Run AWS demo tests
56+
# run: |
57+
# cd demo/aws
58+
# ../../target/release/stackql-deploy test demo-stack dev --dry-run
59+
60+
# - name: Run Azure demo tests
61+
# run: |
62+
# cd demo/azure
63+
# ../../target/release/stackql-deploy test demo-stack dev --dry-run
64+
65+
# - name: Run GCP demo tests
66+
# run: |
67+
# cd demo/gcp
68+
# ../../target/release/stackql-deploy test demo-stack dev --dry-run

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ cargo run
1616
# Build and run with command line arguments
1717
cargo run -- build --env prod --provider aws --region us-east-1
1818

19-
2019
./target/release/stackql-deploy --version
2120

2221
./target/release/stackql-deploy --help

action/README.md

Whitespace-only changes.

action/action.yml

Whitespace-only changes.

ci-scripts/build-local.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Make scripts executable
5+
chmod +x ci-scripts/format.sh
6+
chmod +x ci-scripts/lint.sh
7+
chmod +x ci-scripts/test.sh
8+
chmod +x ci-scripts/build.sh
9+
10+
# Print banner
11+
echo "==============================================="
12+
echo " Running Full Local Build Process"
13+
echo "==============================================="
14+
15+
# Run each step in sequence
16+
printf "\n[STEP 1/4] Formatting code...\n"
17+
./ci-scripts/format.sh
18+
19+
printf "\n[STEP 2/4] Running linter...\n"
20+
./ci-scripts/lint.sh
21+
22+
printf "\n[STEP 3/4] Running tests...\n"
23+
# ./ci-scripts/test.sh
24+
25+
printf "\n[STEP 4/4] Building binary...\n"
26+
./ci-scripts/build.sh
27+
28+
printf "\n🎉 Local build process completed successfully!\n"
29+
echo "Binary is available at: ./target/release/stackql-deploy"

ci-scripts/build.sh

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Display script banner
5+
echo "==============================================="
6+
echo " Building stackql-deploy"
7+
echo "==============================================="
8+
9+
# Build in release mode
10+
echo "Building in release mode..."
11+
cargo build --release
12+
13+
# Check if build was successful
14+
if [ $? -eq 0 ]; then
15+
echo -e "\n✅ Build completed successfully!"
16+
echo "Binary location: ./target/release/stackql-deploy"
17+
else
18+
echo -e "\n❌ Build failed!"
19+
exit 1
20+
fi
21+
22+
# Create binaries for different platforms if cross-compilation tools are available
23+
if command -v cross &> /dev/null; then
24+
echo -e "\nCross-compiling for multiple platforms..."
25+
26+
# Build for Windows
27+
echo "Building for Windows..."
28+
cross build --release --target x86_64-pc-windows-gnu
29+
30+
# Build for macOS
31+
echo "Building for macOS..."
32+
cross build --release --target x86_64-apple-darwin
33+
34+
# Build for Linux
35+
echo "Building for Linux..."
36+
cross build --release --target x86_64-unknown-linux-gnu
37+
38+
echo -e "\n✅ Cross-compilation completed!"
39+
echo "Binaries located in ./target/{target}/release/"
40+
fi

ci-scripts/format.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "==============================================="
5+
echo " Running Rust Formatter"
6+
echo "==============================================="
7+
8+
# Run cargo fmt on all crates in workspace
9+
echo "Formatting code with rustfmt..."
10+
cargo fmt --all
11+
12+
echo "✅ Code formatting complete!"

ci-scripts/lint.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Display script banner
5+
echo "==============================================="
6+
echo " Running Rust Linter (clippy)"
7+
echo "==============================================="
8+
9+
# Run clippy with warning-level lints
10+
cargo clippy -- -D warnings
11+
12+
# Run rustfmt to check formatting
13+
echo -e "\nChecking code formatting with rustfmt..."
14+
cargo fmt -- --check
15+
16+
echo -e "\n✅ Linting passed successfully!"

ci-scripts/test.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Display script banner
5+
echo "==============================================="
6+
echo " Running Tests for stackql-deploy"
7+
echo "==============================================="
8+
9+
# Run unit tests
10+
echo "Running unit tests..."
11+
cargo test --lib
12+
13+
# Run integration tests if they exist
14+
echo -e "\nRunning integration tests..."
15+
cargo test --test '*'
16+
17+
# Run doc tests
18+
echo -e "\nRunning documentation tests..."
19+
cargo test --doc
20+
21+
echo -e "\n✅ All tests passed successfully!"

src/commands/info.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ pub fn execute() {
4141
};
4242

4343
// Get installed providers
44-
let providers = match get_installed_providers() {
45-
Ok(provs) => provs,
46-
Err(_) => Vec::new(),
47-
};
44+
let providers = get_installed_providers().unwrap_or_default();
4845

4946
// Print information
5047
println!("{}", "stackql-deploy CLI".green().bold());

0 commit comments

Comments
 (0)