feat(rust-package): Rust package for using Magento testcontainers #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
- name: "install Rust nightly" | |
uses: dtolnay/rust-toolchain@nightly | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
save-if: ${{ github.ref == 'refs/heads/main' }} | |
- name: Select minimal version | |
run: cargo +nightly update -Z minimal-versions | |
- 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 }} |