diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4c93afb..95dd91e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Publish to crates.io +name: ๐Ÿš€ Publish to crates.io on: push: @@ -6,29 +6,17 @@ on: - v** jobs: - build: + test: + uses: ./.github/workflows/test.yml + + publish: name: ๐Ÿš€ Publish to crates.io + needs: test runs-on: ubuntu-latest steps: - name: ๐Ÿ›  Checkout uses: actions/checkout@v4 - - name: ๐Ÿ“ฆ Cargo clippy (default features) - run: | - cargo clippy -- -D warnings - - - name: ๐Ÿ“ฆ Cargo clippy (all features) - run: | - cargo clippy --all-features -- -D warnings - - - name: ๐Ÿ“ฆ Cargo build (default features) - run: | - cargo build --release - - - name: ๐Ÿ“ฆ Cargo build (all features) - run: | - cargo build --release --all-features - - name: ๐Ÿš€ Publish Crate env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7d442fd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: ๐Ÿงช Test + +on: + pull_request: + workflow_call: + +jobs: + test: + name: ๐Ÿงช Test (${{ matrix.profile }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + profile: + - debug + - release + steps: + - name: ๐Ÿ›  Checkout + uses: actions/checkout@v4 + + - name: ๐Ÿ”ง Install cargo-hack + uses: taiki-e/install-action@v2 + with: + tool: cargo-hack + + - name: ๐Ÿ“ฆ Cargo clippy (feature powerset) + run: | + cargo hack clippy --feature-powerset ${{ matrix.profile == 'release' && '--release' || '' }} -- -D warnings + + - name: ๐Ÿงช Cargo test (feature powerset) + run: | + cargo hack test --feature-powerset ${{ matrix.profile == 'release' && '--release' || '' }} diff --git a/tests/openapi.rs b/tests/openapi.rs deleted file mode 100644 index 9a49d97..0000000 --- a/tests/openapi.rs +++ /dev/null @@ -1,7 +0,0 @@ -#[cfg(feature = "utoipa")] -#[test] -fn test_openapi() { - use utoipa::OpenApi; - let openapi = platz_chart_ext::openapi::OpenApi::openapi(); - println!("{}", openapi.to_json().unwrap()); -}