-
Notifications
You must be signed in to change notification settings - Fork 359
98 lines (94 loc) · 2.53 KB
/
build.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
name: Rust
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
rust:
- "1.58.0" # Current MSRV
- stable
- beta
- nightly
target:
- ""
- x86_64-unknown-linux-musl
include:
- rust: nightly
allow_failure: true
env:
RUST_BACKTRACE: 1
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Build
run: cargo build --all --verbose
env:
TARGET: ${{ matrix.target }}
continue-on-error: ${{ matrix.allow_failure }}
- name: Run tests
run: cargo test --all --verbose
env:
TARGET: ${{ matrix.target }}
continue-on-error: ${{ matrix.allow_failure }}
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- name: Run fmt check
run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Run clippy check
run: cargo clippy
check-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Check examples
working-directory: examples
shell: bash
run: ./check-examples.sh
# publish rustdoc to a gh-pages branch on pushes to main
# this can be helpful to those depending on the mainline branch
publish-docs:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Set up Rust
uses: hecrj/setup-rust-action@v1
- uses: actions/checkout@v2
- name: Generate Docs
run: |
cargo doc --no-deps
echo "<meta http-equiv=refresh content=0;url=lambda_runtime/index.html>" > target/doc/index.html
- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc