5
5
branches :
6
6
- main
7
7
- release-*
8
+ tags :
9
+ - v*.*.*
8
10
pull_request :
9
11
branches :
10
12
- main
11
13
- release-*
12
14
workflow_dispatch :
13
15
14
16
jobs :
17
+ lint :
18
+ runs-on : ubuntu-latest
19
+ env :
20
+ RUST_LOG : info
21
+ steps :
22
+
23
+ name : Cancel Outdated Builds
24
+ with :
25
+ all_but_latest : true
26
+ access_token : ${{ github.token }}
27
+
28
+ - uses : actions/checkout@v4
29
+ name : Checkout Repository
30
+
31
+ - uses : dtolnay/rust-toolchain@stable
32
+
33
+ - uses : Swatinem/rust-cache@v2
34
+ name : Enable Rust Caching
35
+
36
+ - name : Format Check
37
+ run : cargo fmt -- --check
38
+
39
+ - uses : actions-rs/clippy-check@v1
40
+ name : Clippy
41
+ with :
42
+ token : ${{ github.token }}
43
+ args : --workspace --all-features --all-targets -- -D warnings
44
+
15
45
build :
16
46
runs-on : ubuntu-latest
17
47
env :
46
76
github_token : ${{ secrets.GITHUB_TOKEN }}
47
77
publish_dir : ./target/doc
48
78
cname : tide-disco.docs.espressosys.com
79
+
80
+ test :
81
+ runs-on : ubuntu-latest
82
+ env :
83
+ RUST_LOG : info
84
+ steps :
85
+
86
+ name : Cancel Outdated Builds
87
+ with :
88
+ all_but_latest : true
89
+ access_token : ${{ github.token }}
90
+
91
+ - uses : actions/checkout@v4
92
+ name : Checkout Repository
93
+
94
+ - uses : dtolnay/rust-toolchain@stable
95
+
96
+ - uses : Swatinem/rust-cache@v2
97
+ name : Enable Rust Caching
98
+
99
+ - name : Build tests
100
+ run : cargo test --workspace --release --all-features --no-run
101
+
102
+ - name : Test
103
+ run : cargo test --workspace --release --all-features --verbose -- --test-threads 2
104
+ timeout-minutes : 60
105
+
106
+ docs :
107
+ runs-on : ubuntu-latest
108
+ env :
109
+ RUST_LOG : info
110
+ steps :
111
+
112
+ name : Cancel Outdated Builds
113
+ with :
114
+ all_but_latest : true
115
+ access_token : ${{ github.token }}
116
+
117
+ - uses : actions/checkout@v4
118
+ name : Checkout Repository
119
+
120
+ - uses : dtolnay/rust-toolchain@stable
121
+
122
+ - uses : Swatinem/rust-cache@v2
123
+ name : Enable Rust Caching
124
+
125
+ - name : Generate Documentation
126
+ run : |
127
+ cargo doc --no-deps --lib --release --all-features
128
+ echo '<meta http-equiv="refresh" content="0; url=base64_bytes">' > target/doc/index.html
129
+
130
+ - name : Deploy Documentation
131
+ uses : peaceiris/actions-gh-pages@v3
132
+ if : ${{ github.ref == 'refs/heads/main' }}
133
+ with :
134
+ github_token : ${{ secrets.GITHUB_TOKEN }}
135
+ publish_dir : ./target/doc
136
+ cname : base64-bytes.docs.espressosys.com
137
+
138
+ publish :
139
+ needs :
140
+ - build
141
+ - test
142
+ - lint
143
+ - docs
144
+ runs-on : ubuntu-latest
145
+ steps :
146
+ - uses : actions/checkout@v3
147
+ - uses : actions-rs/toolchain@v1
148
+ with :
149
+ toolchain : stable
150
+ override : true
151
+ - uses : katyo/publish-crates@v2
152
+ with :
153
+ # Only do an actual publish if this is a push to a release tag. Otherwise, do a dry run.
154
+ dry-run : ${{ !(github.event_name == 'push' && github.ref_type == 'tag') }}
155
+ ignore-unpublished-changes : true
0 commit comments