Skip to content

Commit b4329f9

Browse files
committed
ci: workflow to show the tracker contract in markdown
1 parent f87793e commit b4329f9

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/contract.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Contract
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
env:
8+
CARGO_TERM_COLOR: always
9+
10+
jobs:
11+
contract:
12+
name: Contract
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
toolchain: [stable, nightly]
18+
19+
steps:
20+
- id: checkout
21+
name: Checkout Repository
22+
uses: actions/checkout@v4
23+
24+
- id: setup
25+
name: Setup Toolchain
26+
uses: dtolnay/rust-toolchain@stable
27+
with:
28+
toolchain: ${{ matrix.toolchain }}
29+
components: llvm-tools-preview
30+
31+
- id: cache
32+
name: Enable Job Cache
33+
uses: Swatinem/rust-cache@v2
34+
35+
- id: tools
36+
name: Install Tools
37+
uses: taiki-e/install-action@v2
38+
with:
39+
tool: cargo-llvm-cov, cargo-nextest
40+
41+
- id: pretty-test
42+
name: Install pretty-test
43+
run: cargo install cargo-pretty-test
44+
45+
- id: contract
46+
name: Run contract
47+
run: |
48+
cargo test --lib --bins
49+
cargo pretty-test --lib --bins
50+
51+
- id: summary
52+
name: Generate contract Summary
53+
run: |
54+
echo "### Tracker Living Contract! :rocket:" >> $GITHUB_STEP_SUMMARY
55+
cargo pretty-test --lib --bins --color=never >> $GITHUB_STEP_SUMMARY
56+
echo '```console' >> $GITHUB_STEP_SUMMARY
57+
echo "$OUTPUT" >> $GITHUB_STEP_SUMMARY
58+
echo '```' >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)