Merge pull request #4 from raiderrobert/fix/cargo-fmt #8
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: -Dwarnings | |
| jobs: | |
| check: | |
| name: Check & Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt --all --check | |
| - name: Clippy | |
| run: cargo clippy --all-targets --all-features | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run unit tests | |
| run: cargo test --lib --all | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run integration tests | |
| run: cargo test --test integration | |
| external-templates: | |
| name: External Template Compatibility | |
| runs-on: ubuntu-latest | |
| needs: [unit-tests, integration-tests] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build diecut | |
| run: cargo build --release | |
| - name: Test cookiecutter-pypackage | |
| run: | | |
| git clone --depth 1 https://github.com/audreyfeldroy/cookiecutter-pypackage.git /tmp/cc-pypackage | |
| ./target/release/diecut new /tmp/cc-pypackage --defaults --output /tmp/out-pypackage || echo "::warning::cookiecutter-pypackage failed (may use unsupported features)" | |
| - name: Test cookiecutter-django | |
| run: | | |
| git clone --depth 1 https://github.com/cookiecutter/cookiecutter-django.git /tmp/cc-django | |
| ./target/release/diecut new /tmp/cc-django --defaults --output /tmp/out-django || echo "::warning::cookiecutter-django failed (may use unsupported features)" | |
| - name: Test cookiecutter-golang | |
| run: | | |
| git clone --depth 1 https://github.com/lacion/cookiecutter-golang.git /tmp/cc-golang | |
| ./target/release/diecut new /tmp/cc-golang --defaults --output /tmp/out-golang || echo "::warning::cookiecutter-golang failed (may use unsupported features)" |