-
Notifications
You must be signed in to change notification settings - Fork 5
87 lines (75 loc) · 2.25 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
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
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Build
run: cargo build
- name: Run tests
run: cargo test --all-features
- name: Run benchmark tests
run: cargo test --benches --all-features
# documentation
- name: Build documentation
run: cargo doc --frozen --no-deps
- name: Create documentation index
# cargo doc does not generate a top-level index,
# create a redirect to our own crate doc
run: |
cat << EOF > target/doc/index.html
<meta http-equiv="refresh" content="0; url=./reactor_rt/index.html" />
EOF
- name: Publish documentation
uses: peaceiris/[email protected]
with:
publish_branch: gh_pages
publish_dir: target/doc
github_token: ${{ secrets.GITHUB_TOKEN }}
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-features -- -D warnings
fetch-lf:
uses: lf-lang/lingua-franca/.github/workflows/extract-ref.yml@master
with:
file: 'lingua-franca-ref.txt'
lf-tests:
needs: fetch-lf
uses: lf-lang/lingua-franca/.github/workflows/rs-tests.yml@master
with:
# If this is a PR build, use the head_ref. That ref is the tip of the PR branch,
# not merged with master. This therefore assumes the PR is up-to-date with the main branch.
# This is important because we can't ask Cargo to fetch github.ref if that ref is
# a merge commit automatically committed by GitHub.
runtime-ref: ${{ github.head_ref || github.ref }}
compiler-ref: ${{ needs.fetch-lf.outputs.ref }}