-
Notifications
You must be signed in to change notification settings - Fork 37
80 lines (78 loc) · 2.28 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
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
name: CI
jobs:
build_and_test:
name: Test and build on Linux
runs-on: ubuntu-latest
env:
RUST_LOG: debug # Output debug log
RUST_BACKTRACE: 1 # Dump backtrace on panic
DYNEIN_TEST_NO_DOCKER_SETUP: true
# define AWS credentials in environment for test
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
services:
dynamodb:
# Pinned to the version not to be broken with latest
image: amazon/dynamodb-local:1.22.0
ports:
- 8000:8000
- 8001:8000
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy
# Pinned to the commit hash of v2.2.1
- uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
shared-key: build-and-test
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings
- uses: actions-rs/cargo@v1
with:
command: test
args: --no-fail-fast --all-features
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features
build_and_test_on_windows:
name: Test and build on Windows
runs-on: windows-2022
env:
RUST_LOG: debug # Output debug log
RUST_BACKTRACE: 1 # Dump backtrace on panic
DYNEIN_TEST_NO_DOCKER_SETUP: true
# define AWS credentials in environment for test
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
components: rustfmt, clippy
# Pinned to the commit hash of v2.2.1
- uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f
with:
shared-key: build-and-test-on-windows
- uses: actions-rs/cargo@v1
with:
# Currently, we only conduct snapshot tests because GitHub Actions does not support containers in Windows.
command: test
args: cli_tests
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --all-features