forked from awsdocs/aws-doc-sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (55 loc) · 2.07 KB
/
rust.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
name: Rust
on:
push:
paths:
- "rust_dev_preview/**"
branches:
- main
pull_request:
paths:
- "rust_dev_preview/**"
workflow_dispatch:
permissions:
contents: read
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: setup
run: >
sudo apt-get update && sudo apt-get install -y libclang-dev &&
(
echo "Removing unwanted software... " ;
echo "Before:" ; df -h ;
sudo apt-get clean ;
sudo rm -rf /usr/share/dotnet ;
sudo rm -rf /usr/local/lib/android ;
sudo rm -rf /opt/ghc ;
sudo rm -rf /opt/hostedtoolcache/CodeQL ;
sudo docker image prune --all --force ;
echo "After:" ; df -h ;
)
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.69
components: clippy, rustfmt
- uses: actions/checkout@v3
- name: Rust format
run: >
"$HOME/.cargo/bin/cargo" fmt --manifest-path rust_dev_preview/cross_service/Cargo.toml --all --check &&
"$HOME/.cargo/bin/cargo" fmt --manifest-path rust_dev_preview/examples/Cargo.toml --all --check &&
"$HOME/.cargo/bin/cargo" fmt --manifest-path rust_dev_preview/webassembly/Cargo.toml --all --check
- name: Rust lint
if: success() || failure()
run: >
"$HOME/.cargo/bin/cargo" clippy --manifest-path rust_dev_preview/cross_service/Cargo.toml -- -D warnings &&
"$HOME/.cargo/bin/cargo" clippy --manifest-path rust_dev_preview/examples/Cargo.toml -- -D warnings &&
"$HOME/.cargo/bin/cargo" clippy --manifest-path rust_dev_preview/webassembly/Cargo.toml -- -D warnings
- name: Rust test
run: >
"$HOME/.cargo/bin/cargo" test --manifest-path rust_dev_preview/cross_service/Cargo.toml --all &&
"$HOME/.cargo/bin/cargo" test --manifest-path rust_dev_preview/examples/Cargo.toml --all &&
"$HOME/.cargo/bin/cargo" test --manifest-path rust_dev_preview/webassembly/Cargo.toml --all
env:
APP_ENVIRONMENT: test