-
-
Notifications
You must be signed in to change notification settings - Fork 281
128 lines (116 loc) · 3.52 KB
/
powerset.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: "Check powerset"
env:
RUSTFLAGS: -Dwarnings
TARGETS: '{
"no_std": [
"thumbv7em-none-eabihf"
],
"std_no_offset": [
],
"std_with_offset": [
"aarch64-unknown-linux-gnu",
"i686-pc-windows-gnu",
"i686-pc-windows-msvc",
"i686-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-pc-windows-gnu",
"x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",
"aarch64-linux-android",
"wasm32-wasi",
"x86_64-linux-android",
"x86_64-unknown-netbsd",
"x86_64-unknown-illumos"
]
}'
concurrency:
group: powerset-${{ github.head_ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
on:
schedule:
- cron: "0 0 * * 1" # midnight on Monday
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
workflow_dispatch:
jobs:
check:
name: Type checking (${{ matrix.kind.name }}, ${{ matrix.rust.name }})
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- { version: "1.67.0", name: MSRV }
- { version: stable, name: stable }
kind:
- name: no_std
query: .no_std + .std_no_offset + .std_with_offset
exclude_features:
- std
- local-offset
- quickcheck
- formatting
- serde-human-readable
- serde-well-known
- name: std_no_offset
query: .std_no_offset + .std_with_offset
exclude_features: [local-offset]
enable_features: [std]
- name: std_with_offset
query: .std_with_offset
enable_features: [std, local-offset]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Generate target list
run: |
echo $TARGETS \
| jq -r '${{ matrix.kind.query }} | join(",") | "TARGET_LIST=" + .' >> $GITHUB_ENV
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
targets: ${{ env.TARGET_LIST }}
toolchain: ${{ matrix.rust.version}}
- name: Install cargo-hack
shell: bash
run: |
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
- name: Check feature powerset
run: |
echo $TARGETS \
| jq -r '${{ matrix.kind.query }} | map("--target " + .) | join(" ")' \
| xargs -d" " \
cargo hack check \
-p time \
--no-dev-deps \
--feature-powerset \
--optional-deps \
--exclude-features default,wasm-bindgen,${{ join(matrix.kind.exclude_features) }} ${{
matrix.kind.enable_features && format('--features {0}', join(matrix.kind.enable_features)) }}
release:
name: Create release
if: startsWith(github.ref, 'refs/tags') && github.run_attempt == 1
needs: check
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create release
uses: ncipollo/release-action@v1
with:
body: See the [changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md) for details.
prerelease: |
${{
contains(github.ref, 'alpha')
|| contains(github.ref, 'beta')
|| contains(github.ref, 'rc')
}}