Skip to content

Commit

Permalink
Test the example in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Kijewski committed Oct 27, 2023
1 parent 6b37338 commit 3fdba56
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ex: ["bytes", "macros", "serde", "traits"]
ex: ["bytes", "macros", "serde", "traits"]
steps:
- uses: actions/checkout@v4

Expand All @@ -112,5 +112,26 @@ jobs:
with:
key: ${{ matrix.ex }}

- name: Run example-bytes
- name: Run example-${{ matrix.ex }}
run: cargo run --manifest-path examples/${{ matrix.ex }}/Cargo.toml

example-tests:
name: example - ${{ matrix.ex }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ex: ["diesel", "sqlx"]
steps:
- uses: actions/checkout@v4

- name: Install toolchain
run: |
rustup toolchain install nightly --no-self-update --profile minimal
rustup override set nightly
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.ex }}-test

- name: Test example-${{ matrix.ex }}
run: cargo test --manifest-path examples/${{ matrix.ex }}/Cargo.toml
2 changes: 1 addition & 1 deletion examples/diesel/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(test)]
#![cfg(all(test, not(miri)))]

mod models;
mod schema;
Expand Down
2 changes: 1 addition & 1 deletion examples/sqlx/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(test)]
#![cfg(all(test, not(miri)))]

use std::hint::black_box;

Expand Down

0 comments on commit 3fdba56

Please sign in to comment.