Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 65 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: CI

on:
push:
Expand All @@ -7,55 +7,87 @@ on:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'ci-scripts/**'
- '.github/workflows/build.yml'
pull_request:
branches: [main]
paths:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'ci-scripts/**'
- '.github/workflows/build.yml'

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build and Test
fmt:
name: Formatting
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

components: rustfmt

- name: Check formatting
run: cargo fmt --all -- --check

lint:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Run clippy
run: cargo clippy -- -D warnings

test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Set executable permissions for CI scripts
run: |
chmod +x ci-scripts/format.sh
chmod +x ci-scripts/lint.sh
chmod +x ci-scripts/test.sh
chmod +x ci-scripts/build.sh

- name: Format code
run: ./ci-scripts/format.sh

- name: Run linter
run: ./ci-scripts/lint.sh


- name: Run tests
run: ./ci-scripts/test.sh

- name: Build release
run: ./ci-scripts/build.sh

# - name: Upload artifact
# uses: actions/upload-artifact@v4
# with:
# name: stackql-deploy
# path: target/release/stackql-deploy
run: cargo test

build:
name: Build
runs-on: ubuntu-latest
needs: [fmt, lint, test]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Build release binary
run: cargo build --release

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: stackql-deploy-linux-x86_64
path: target/release/stackql-deploy
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@ chrono = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.9"
serde_json = "1.0"
thiserror = "1.0"
thiserror = "1.0"
uuid = { version = "1.0", features = ["v4"] }
base64 = "0.21"
dotenvy = "0.15"
regex = "1.10"
Loading
Loading