Skip to content

Commit c129b67

Browse files
authored
Merge branch 'main' into main
2 parents a43d145 + 2a6c425 commit c129b67

File tree

16 files changed

+175
-145
lines changed

16 files changed

+175
-145
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Build
22

3+
concurrency:
4+
group: build-${{ github.head_ref }}
5+
cancel-in-progress: true
6+
37
env:
48
CARGO_INCREMENTAL: 0
59

.github/workflows/powerset.yaml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: "Check powerset"
2+
3+
env:
4+
RUSTFLAGS: -Dwarnings
5+
6+
concurrency:
7+
group: powerset-${{ github.head_ref }}
8+
cancel-in-progress: true
9+
10+
on:
11+
schedule:
12+
- cron: "0 0 * * 1,5" # midnight on Monday, Friday
13+
push:
14+
tags:
15+
- "v[0-9]+.[0-9]+.[0-9]+"
16+
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
17+
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
18+
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
19+
workflow_dispatch:
20+
21+
jobs:
22+
check-powerset:
23+
name: Type checking (${{ matrix.target.name }})
24+
runs-on: ubuntu-latest
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
target:
29+
# All tier 1 platforms as of 2020-12-28
30+
- {
31+
name: "ARM64 Linux",
32+
triple: aarch64-unknown-linux-gnu,
33+
has_std: true,
34+
}
35+
- { name: "32-bit MinGW", triple: i686-pc-windows-gnu, has_std: true }
36+
- { name: "32-bit MSVC", triple: i686-pc-windows-msvc, has_std: true }
37+
- {
38+
name: "32-bit Linux",
39+
triple: i686-unknown-linux-gnu,
40+
has_std: true,
41+
}
42+
- { name: "64-bit macOS", triple: x86_64-apple-darwin, has_std: true }
43+
- {
44+
name: "64-bit MinGW",
45+
triple: x86_64-pc-windows-gnu,
46+
has_std: true,
47+
}
48+
- {
49+
name: "64-bit MSVC",
50+
triple: x86_64-pc-windows-msvc,
51+
has_std: true,
52+
}
53+
- {
54+
name: "64-bit Linux",
55+
triple: x86_64-unknown-linux-gnu,
56+
has_std: true,
57+
}
58+
# Select tier 2 platforms as of 2020-12-28
59+
- { name: "ARM64 Fuchsia", triple: aarch64-fuchsia, has_std: true }
60+
- {
61+
name: "ARM64 Android",
62+
triple: aarch64-linux-android,
63+
has_std: true,
64+
}
65+
- {
66+
name: "Bare Cortex",
67+
triple: thumbv7em-none-eabihf,
68+
has_std: false,
69+
}
70+
- { name: "WASI", triple: wasm32-wasi, has_std: true }
71+
- { name: "64-bit Fuchsia", triple: x86_64-fuchsia, has_std: true }
72+
- {
73+
name: "64-bit x86 Android",
74+
triple: x86_64-linux-android,
75+
has_std: true,
76+
}
77+
- { name: "NetBSD", triple: x86_64-unknown-netbsd, has_std: true }
78+
79+
steps:
80+
- name: Checkout sources
81+
uses: actions/checkout@v2
82+
83+
- name: Install toolchain
84+
uses: actions-rs/toolchain@v1
85+
with:
86+
profile: minimal
87+
toolchain: stable
88+
target: ${{ matrix.target.triple }}
89+
override: true
90+
91+
- name: Install cargo-hack
92+
shell: bash
93+
run: |
94+
curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
95+
96+
- name: Check feature powerset
97+
uses: actions-rs/cargo@v1
98+
with:
99+
command: hack
100+
args: |
101+
check
102+
--no-dev-deps
103+
--version-range 1.51..
104+
--clean-per-version
105+
--feature-powerset
106+
--optional-deps
107+
--exclude-features default,std,local-offset,quickcheck,quickcheck-dep,time-macros,formatting,itoa,serde-human-readable
108+
--exclude-all-features
109+
--target ${{ matrix.target.triple }}
110+
if: matrix.target.has_std == false
111+
112+
- name: Check feature powerset
113+
uses: actions-rs/cargo@v1
114+
with:
115+
command: hack
116+
args: |
117+
check
118+
--no-dev-deps
119+
--version-range 1.51..
120+
--clean-per-version
121+
--feature-powerset
122+
--optional-deps
123+
--exclude-features default,quickcheck-dep,time-macros,itoa
124+
--target ${{ matrix.target.triple }}
125+
if: matrix.target.has_std == true
126+
127+
release:
128+
name: Create release
129+
if: startsWith(${{ github.ref }}, 'refs/tags')
130+
needs: check-powerset
131+
runs-on: ubuntu-latest
132+
steps:
133+
- name: Checkout code
134+
uses: actions/checkout@v2
135+
136+
- name: Create release
137+
uses: actions/create-release@v1
138+
env:
139+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140+
with:
141+
tag_name: ${{ github.ref }}
142+
release_name: ${{ github.ref }}
143+
body: ""
144+
draft: false
145+
prerelease: |
146+
contains(${{ github.ref }}, 'alpha')
147+
|| contains(${{ github.ref }}, 'beta')
148+
|| contains(${{ github.ref }}, 'rc')

.github/workflows/release.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/scheduled.yaml

Lines changed: 0 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: "Scheduled tasks"
33
on:
44
schedule:
55
- cron: "0 0 * * 1,5" # midnight on Monday, Friday
6-
push:
7-
paths: [".github/workflows/scheduled.yaml"] # build when this file is updated
8-
workflow_dispatch:
96

107
jobs:
118
stale:
@@ -34,108 +31,3 @@ jobs:
3431
uses: actions-rs/audit-check@v1
3532
with:
3633
token: ${{ secrets.GITHUB_TOKEN }}
37-
38-
check-other-targets:
39-
name: Type checking (${{ matrix.target.name }})
40-
runs-on: ubuntu-20.04
41-
strategy:
42-
fail-fast: false
43-
matrix:
44-
target:
45-
# All tier 1 platforms as of 2020-12-28
46-
- {
47-
name: "ARM64 Linux",
48-
triple: aarch64-unknown-linux-gnu,
49-
has_std: true,
50-
}
51-
- { name: "32-bit MinGW", triple: i686-pc-windows-gnu, has_std: true }
52-
- { name: "32-bit MSVC", triple: i686-pc-windows-msvc, has_std: true }
53-
- {
54-
name: "32-bit Linux",
55-
triple: i686-unknown-linux-gnu,
56-
has_std: true,
57-
}
58-
- { name: "64-bit macOS", triple: x86_64-apple-darwin, has_std: true }
59-
- {
60-
name: "64-bit MinGW",
61-
triple: x86_64-pc-windows-gnu,
62-
has_std: true,
63-
}
64-
- {
65-
name: "64-bit MSVC",
66-
triple: x86_64-pc-windows-msvc,
67-
has_std: true,
68-
}
69-
- {
70-
name: "64-bit Linux",
71-
triple: x86_64-unknown-linux-gnu,
72-
has_std: true,
73-
}
74-
# Select tier 2 platforms as of 2020-12-28
75-
- { name: "ARM64 Fuchsia", triple: aarch64-fuchsia, has_std: true }
76-
- {
77-
name: "ARM64 Android",
78-
triple: aarch64-linux-android,
79-
has_std: true,
80-
}
81-
- {
82-
name: "Bare Cortex",
83-
triple: thumbv7em-none-eabihf,
84-
has_std: false,
85-
}
86-
- { name: "WASI", triple: wasm32-wasi, has_std: true }
87-
- { name: "64-bit Fuchsia", triple: x86_64-fuchsia, has_std: true }
88-
- {
89-
name: "64-bit x86 Android",
90-
triple: x86_64-linux-android,
91-
has_std: true,
92-
}
93-
- { name: "NetBSD", triple: x86_64-unknown-netbsd, has_std: true }
94-
95-
steps:
96-
- name: Checkout sources
97-
uses: actions/checkout@v2
98-
99-
- name: Install toolchain
100-
uses: actions-rs/toolchain@v1
101-
with:
102-
profile: minimal
103-
toolchain: stable
104-
target: ${{ matrix.target.triple }}
105-
override: true
106-
107-
- name: Install cargo-hack
108-
shell: bash
109-
run: |
110-
curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin
111-
112-
- name: Check feature powerset
113-
uses: actions-rs/cargo@v1
114-
with:
115-
command: hack
116-
args: |
117-
check
118-
--no-dev-deps
119-
--version-range 1.51..
120-
--clean-per-version
121-
--feature-powerset
122-
--optional-deps
123-
--exclude-features default,std,local-offset,quickcheck,quickcheck-dep,time-macros,formatting,itoa,serde-human-readable
124-
--exclude-all-features
125-
--target ${{ matrix.target.triple }}
126-
if: matrix.target.has_std == false
127-
128-
- name: Check feature powerset
129-
uses: actions-rs/cargo@v1
130-
with:
131-
command: hack
132-
args: |
133-
check
134-
--no-dev-deps
135-
--version-range 1.51..
136-
--clean-per-version
137-
--feature-powerset
138-
--optional-deps
139-
--exclude-features default,quickcheck-dep,time-macros,itoa
140-
--target ${{ matrix.target.triple }}
141-
if: matrix.target.has_std == true

src/date.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! The [`Date`] struct and its associated `impl`s.
2+
13
use core::fmt;
24
use core::ops::{Add, Sub};
35
use core::time::Duration as StdDuration;

src/duration.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! The [`Duration`] struct and its associated `impl`s.
2+
13
use core::cmp::Ordering;
24
use core::convert::{TryFrom, TryInto};
35
use core::fmt;

src/error/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Various error types returned by methods in the time crate.
2+
13
mod component_range;
24
mod conversion_range;
35
mod different_variant;

src/ext.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Extension traits.
2+
13
use core::time::Duration as StdDuration;
24

35
use crate::Duration;

src/instant.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! The [`Instant`] struct and its associated `impl`s.
2+
13
use core::cmp::{Ord, Ordering, PartialEq, PartialOrd};
24
use core::convert::{TryFrom, TryInto};
35
use core::ops::{Add, Sub};

src/lib.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ macro_rules! cascade {
197197
(@year year) => {};
198198

199199
// Cascade an out-of-bounds value from "from" to "to".
200-
($(!$from_not_mut:ident)? $from:ident in $min:literal.. $max:literal => $to:tt) => {
200+
($from:ident in $min:literal.. $max:literal => $to:tt) => {
201201
#[allow(unused_comparisons, unused_assignments)]
202202
if $from >= $max {
203203
$from -= $max - $min;
@@ -283,30 +283,22 @@ macro_rules! const_try_opt {
283283
}
284284
// endregion macros
285285

286-
/// The [`Date`] struct and its associated `impl`s.
287286
mod date;
288-
/// The [`Duration`] struct and its associated `impl`s.
289287
mod duration;
290-
/// Various error types returned by methods in the time crate.
291288
pub mod error;
292-
/// Extension traits.
293289
pub mod ext;
294290
#[cfg(any(feature = "formatting", feature = "parsing"))]
295291
pub mod format_description;
296292
#[cfg(feature = "formatting")]
297293
pub mod formatting;
298-
/// The [`Instant`] struct and its associated `impl`s.
299294
#[cfg(feature = "std")]
300295
mod instant;
301-
/// Macros to construct statically known values.
302296
#[cfg(feature = "macros")]
303297
pub mod macros;
304298
mod month;
305-
/// The [`OffsetDateTime`] struct and its associated `impl`s.
306299
mod offset_date_time;
307300
#[cfg(feature = "parsing")]
308301
pub mod parsing;
309-
/// The [`PrimitiveDateTime`] struct and its associated `impl`s.
310302
mod primitive_date_time;
311303
#[cfg(feature = "quickcheck")]
312304
#[cfg_attr(__time_03_docs, doc(cfg(feature = "quickcheck")))]
@@ -320,12 +312,9 @@ mod rand;
320312
pub mod serde;
321313
#[cfg(test)]
322314
mod tests;
323-
/// The [`Time`] struct and its associated `impl`s.
324315
mod time;
325-
/// The [`UtcOffset`] struct and its associated `impl`s.
326316
mod utc_offset;
327317
pub mod util;
328-
/// Days of the week.
329318
mod weekday;
330319

331320
pub use crate::date::Date;

0 commit comments

Comments
 (0)