-
Notifications
You must be signed in to change notification settings - Fork 12
180 lines (170 loc) · 7.21 KB
/
ci.yml
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
pull_request:
# Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed
concurrency:
group: ci-yaml-${{ github.ref }}
cancel-in-progress: true
env:
RUSTFLAGS: -Dwarnings
RUSTDOCFLAGS: -Dwarnings
RUST_BACKTRACE: 1
rust_version: nightly-2024-10-29
jobs:
fmt:
name: Code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
name: Install Rust
with:
toolchain: ${{ env.rust_version }}
override: true
components: rustfmt
- name: Check code formatting
run: |
if ! rustfmt --check --edition 2021 $(git ls-files '*.rs'); then
echo "Please run 'cargo fmt' to fix rustfmt errors."
exit 1
fi
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
name: Install Rust
with:
toolchain: ${{ env.rust_version }}
override: true
components: clippy
# Pinned to the commit hash of v1.3.0
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641
- name: Clippy
run: cargo clippy --all-features
env:
RUSTFLAGS: ${{ env.RUSTFLAGS }}
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
name: Install Rust
with:
toolchain: ${{ env.rust_version }}
override: true
# Pinned to the commit hash of v1.3.0
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641
- name: Tests
run: cargo test --all-features
env:
RUSTFLAGS: ${{ env.RUSTFLAGS }}
RUST_BACKTRACE: ${{ env.RUST_BACKTRACE }}
doc:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
name: Install Rust
with:
toolchain: ${{ env.rust_version }}
override: true
# Pinned to the commit hash of v1.3.0
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641
- name: Check Docs
run: cargo doc --all-features --document-private-items
env:
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }}
smoketest-aws-sdk:
name: Smoketest against the AWS Rust SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: cargo-check-external-types
- uses: actions/checkout@v3
with:
repository: awslabs/aws-sdk-rust
path: aws-sdk-rust
- uses: actions-rs/toolchain@v1
name: Install Rust
with:
toolchain: ${{ env.rust_version }}
override: true
# Pinned to the commit hash of v1.3.0
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641
- name: Run
run: |
cargo install --locked --path cargo-check-external-types
cd aws-sdk-rust/sdk
cargo check-external-types --all-features --config aws-config/external-types.toml --manifest-path aws-config/Cargo.toml
cargo check-external-types --all-features --config aws-endpoint/external-types.toml --manifest-path aws-endpoint/Cargo.toml
cargo check-external-types --all-features --config aws-http/external-types.toml --manifest-path aws-http/Cargo.toml
cargo check-external-types --all-features --config aws-runtime/external-types.toml --manifest-path aws-runtime/Cargo.toml
cargo check-external-types --all-features --config aws-sig-auth/external-types.toml --manifest-path aws-sig-auth/Cargo.toml
cargo check-external-types --all-features --config aws-sigv4/external-types.toml --manifest-path aws-sigv4/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-async/external-types.toml --manifest-path aws-smithy-async/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-checksums/external-types.toml --manifest-path aws-smithy-checksums/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-client/external-types.toml --manifest-path aws-smithy-client/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-eventstream/external-types.toml --manifest-path aws-smithy-eventstream/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-http-tower/external-types.toml --manifest-path aws-smithy-http-tower/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-http/external-types.toml --manifest-path aws-smithy-http/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-json/external-types.toml --manifest-path aws-smithy-json/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-query/external-types.toml --manifest-path aws-smithy-query/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-runtime-api/external-types.toml --manifest-path aws-smithy-runtime-api/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-runtime/external-types.toml --manifest-path aws-smithy-runtime/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-types-convert/external-types.toml --manifest-path aws-smithy-types-convert/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-types/external-types.toml --manifest-path aws-smithy-types/Cargo.toml
cargo check-external-types --all-features --config aws-smithy-xml/external-types.toml --manifest-path aws-smithy-xml/Cargo.toml
cargo check-external-types --all-features --config aws-types/external-types.toml --manifest-path aws-types/Cargo.toml
env:
# Intentionally don't set flags
RUSTFLAGS:
RUSTDOCFLAGS:
smoketest-tokio:
name: Smoketest against Tokio
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: cargo-check-external-types
- uses: actions/checkout@v3
with:
repository: tokio-rs/tokio
path: tokio
- uses: actions-rs/toolchain@v1
name: Install Rust
with:
toolchain: ${{ env.rust_version }}
override: true
# Pinned to the commit hash of v1.3.0
- uses: Swatinem/rust-cache@842ef286fff290e445b90b4002cc9807c3669641
- name: Run
run: |
cargo install --locked --path cargo-check-external-types
cargo check-external-types --all-features --manifest-path tokio/tokio/Cargo.toml
env:
# Intentionally don't set flags
RUSTDOCFLAGS:
require-all:
name: All checks pass
needs:
- fmt
- clippy
- test
- doc
- smoketest-aws-sdk
- smoketest-tokio
# Run this job even if its dependency jobs fail
if: always()
runs-on: ubuntu-latest
steps:
- name: Verify jobs succeeded
uses: re-actors/alls-green@3a2de129f0713010a71314c74e33c0e3ef90e696
with:
jobs: ${{ toJSON(needs) }}