Skip to content

Fix review comments - Iter 2 #719

Fix review comments - Iter 2

Fix review comments - Iter 2 #719

Workflow file for this run

name: build
on:
push:
paths-ignore:
- "docs/**"
- "images/**"
- "**.md"
# manual trigger
workflow_dispatch: { }
env:
RUST_LOG: "debug"
RUST_LOG_SPAN_EVENTS: "new,close"
RUST_BACKTRACE: "1"
jobs:
lint_fmt:
name: Lint / Code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy
- name: cargo fmt --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
- name: license headers
run: |
cargo test -p kamu-repo-tools -- license_header
- name: clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets -- -D warnings
lint_deps:
name: Lint / Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
- uses: cargo-bins/cargo-binstall@main
- run: cargo binstall cargo-deny -y
- run: cargo deny check
- run: cargo binstall cargo-udeps -y
- run: cargo udeps --all-targets
test_linux:
name: Test / Linux
runs-on: ubuntu-latest
env:
CARGO_FLAGS: --profile ci --features kamu/ingest-ftp
NEXTEST_FLAGS: --cargo-profile ci --features kamu/ingest-ftp
KAMU_CONTRACTS_DIR: ../../../kamu-contracts
services:
postgres:
image: 'postgres:16'
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: kamu-test
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
with:
repository: kamu-data/kamu-contracts
path: kamu-contracts
- uses: actions-rs/toolchain@v1
- uses: swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: cargo-bins/cargo-binstall@main
- name: Install cargo tools
run: |
cargo binstall cargo-nextest -y --force
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Build node
run: cargo test ${{ env.CARGO_FLAGS }} --no-run
- name: Build contracts
working-directory: kamu-contracts
run: |
npm ci
forge build
- name: Run main set of tests
run: cargo nextest run ${{ env.NEXTEST_FLAGS }} -E '!(test(::database::) | test(::spark::) | test(::flink::))'
- name: SQLite database tests
env:
SQLX_OFFLINE: false
DATABASE_URL: sqlite://kamu.sqlite.db
run: cargo nextest run ${{ env.NEXTEST_FLAGS }} -E 'test(::sqlite::)'
- name: Postgres database tests
env:
SQLX_OFFLINE: false
DATABASE_URL: postgres://root:root@localhost:5432/kamu-test
run: cargo nextest run ${{ env.NEXTEST_FLAGS }} -E 'test(::postgres::)'
- name: Check git diff
run: git diff && git diff-index --quiet HEAD