Skip to content

Commit

Permalink
Also run tests on macOS (#99)
Browse files Browse the repository at this point in the history
* Also run tests on macOS

* Unify CI and local tests
  • Loading branch information
fasterthanlime authored Oct 20, 2024
1 parent 4f8951d commit dc59369
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,18 @@ on:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Run tests (including doctests)
run: cargo test -F full
- name: Install cargo-hack
- name: Install tools
uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- name: Check a few configurations
run: |
cargo hack --feature-powerset --exclude-features=default,full check
- name: Run examples
shell: bash
run: |
pushd merde
EXAMPLES=($(cd examples && for i in *; do echo "${i%.rs}"; done))
for example in "${EXAMPLES[@]}"; do
cargo run --features full,ahash --example "$example"
done
popd
- name: Test zerodeps-example
tool: cargo-hack,just
- name: Run tests
shell: bash
run: |
pushd zerodeps-example
cargo check
cargo check --features=merde
cargo tree --prefix none --no-dedupe | grep -v compact_str
cargo tree --prefix none --no-dedupe --features=merde | grep compact_str
popd
just
7 changes: 6 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
check:
#!/bin/bash -eux
cargo check --all-targets
cargo check --all-features --all-targets
cargo hack --each-feature --exclude-features=default,full check

cargo check --example simple --no-default-features --features=json
cargo run --example simple --features=core,json
cargo hack --each-feature --exclude-features=default,full check -p merde

# can't use cargo-nextest because we want to run doctests
cargo test -F full

pushd zerodeps-example
Expand Down
4 changes: 1 addition & 3 deletions merde_time/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ where

#[cfg(feature = "merde")]
mod merde_impls {
use merde_core::CowStr;

use super::*;

impl merde_core::IntoStatic for Rfc3339<OffsetDateTime> {
Expand All @@ -73,7 +71,7 @@ mod merde_impls {
where
D: merde_core::Deserializer<'s> + ?Sized,
{
let s = CowStr::deserialize(de).await?;
let s = merde_core::CowStr::deserialize(de).await?;
Ok(Rfc3339(
time::OffsetDateTime::parse(
s.as_ref(),
Expand Down

0 comments on commit dc59369

Please sign in to comment.