[go: up one dir, main page]

time 0.2.4

Date and time library. Fully interoperable with the standard library. Mostly compatible with #![no_std].
Documentation
name: Build

on: [push, pull_request]

jobs:
  check:
    name: Type checking
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        rust: [1.34.0, 1.36.0, stable]
        os: [ubuntu-latest, windows-latest, macOS-latest]

    steps:
      - name: Checkout sources
        uses: actions/checkout@v1
        with:
          fetch-depth: 1

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true

      # ensure `#![no_std]` support
      - name: Run `cargo check --no-default-features`
        uses: actions-rs/cargo@v1
        with:
          command: check
          args: --no-default-features
        if: matrix.rust != '1.34.0' # alloc is unstable in 1.34

      # `#![no_std]` and serde
      - name: Run `cargo check --no-default-features --features serde`
        uses: actions-rs/cargo@v1
        with:
          command: check
          args: --no-default-features --features serde
        if: matrix.rust != '1.34.0' # alloc is unstable in 1.34

      # everything
      - name: Run `cargo check --all-features`
        uses: actions-rs/cargo@v1
        with:
          command: check
          args: --all-features

  test:
    name: Test suite
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        rust: [1.34.0, 1.36.0, stable] # 1.36 is when alloc was stabilized
        os: [ubuntu-latest, windows-latest, macOS-latest]

    steps:
      - name: Checkout sources
        uses: actions/checkout@v1
        with:
          fetch-depth: 1

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
          override: true

      # `#![no_std]` support
      - name: Run `cargo test --no-default-features`
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --no-default-features
        if: matrix.rust != '1.34.0' # alloc is unstable in 1.34

      # everything
      - name: Run `cargo test --all-features`
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all-features

  fmt:
    name: Formatting
    runs-on: ubuntu-latest

    steps:
      - name: Checkout sources
        uses: actions/checkout@v1
        with:
          fetch-depth: 1

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: nightly # various unstable options are used
          override: true

      - name: Install rustfmt
        run: rustup component add rustfmt

      - name: Run `cargo fmt -- --check`
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: -- --check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest

    steps:
      - name: Checkout sources
        uses: actions/checkout@v1
        with:
          fetch-depth: 1

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true

      - name: Install clippy
        run: rustup component add clippy

      - name: Run `cargo clippy --features serde,deprecated`
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --features serde,deprecated