Skip to content

Commit

Permalink
feat(rust-package): Rust package for using Magento testcontainers
Browse files Browse the repository at this point in the history
- Added `core` package with building blocks for `ImageBuilder`
- Added `images` with `DbContainer` and `OpenSearchContainer`
- Re-exported runners based on configured features from testcontainers
  crate
  • Loading branch information
IvanChepurnyi committed Jan 7, 2025
1 parent 13369a2 commit 9b2fcee
Show file tree
Hide file tree
Showing 22 changed files with 3,866 additions and 4 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/rust-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Rust Package
env:
CARGO_TERM_COLOR: always
MSRV: '1.81.0'
on:
push:
paths:
- testcontainers-magento-data-rust/**
- Cargo.toml
- Cargo.lock
- .github/workflows/rust-*
pull_request:
paths:
- testcontainers-magento-data-rust/**
- Cargo.toml
- Cargo.lock
- .github/workflows/rust-*
jobs:
check:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@beta
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: rustfmt
run: cargo fmt --all --check

check-docs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: cargo doc
run: cargo doc --all-features --no-deps

test-versions:
needs: check
runs-on: ubuntu-24.04
strategy:
matrix:
rust: [ stable, beta ]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Run tests
run: cargo test --workspace --all-features --all-targets

test-msrv:
needs: check
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.MSRV }}
- uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Run tests
run: cargo +${{ env.MSRV }} test

deny-check:
name: cargo-deny check
runs-on: ubuntu-24.04
continue-on-error: ${{ matrix.checks == 'advisories' }}
strategy:
matrix:
checks:
- advisories
- bans licenses sources
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
manifest-path: ./testcontainers-magento-data-rust/Cargo.toml
rust-version: ${{ env.MSRV }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules/
/build/
!/build/.gitkeep
/composer.lock
/.idea/
/.idea/
/target
Loading

0 comments on commit 9b2fcee

Please sign in to comment.