Skip to content

Commit f9b35c2

Browse files
committed
Add Build/Test/Lint GH Actions workflow
1 parent 71e403b commit f9b35c2

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Build/Test/Lint Rust Code"
2+
3+
on:
4+
push:
5+
6+
# Make sure workflow fails on all warnings, including Clippy lints
7+
env:
8+
RUSTFLAGS: "-Dwarnings"
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
16+
# - name: Install host target
17+
# run: rustup target add ${{ matrix.target }}
18+
#
19+
# - name: Install musl-tools
20+
# run: sudo apt-get install -y musl-tools
21+
22+
- uses: Swatinem/rust-cache@v2
23+
24+
- name: Build CLI Binary
25+
run: cargo build
26+
27+
- name: Build Action Binary
28+
run: cargo build --bin md-table-action --features actions-runner-binary
29+
30+
test:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v6
34+
35+
# - name: Install host target
36+
# run: rustup target add ${{ matrix.target }}
37+
#
38+
# - name: Install musl-tools
39+
# run: sudo apt-get install -y musl-tools
40+
41+
- uses: Swatinem/rust-cache@v2
42+
43+
- run: cargo test
44+
45+
lint-clippy:
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v6
49+
50+
# - name: Install host target
51+
# run: rustup target add ${{ matrix.target }}
52+
#
53+
# - name: Install musl-tools
54+
# run: sudo apt-get install -y musl-tools
55+
56+
- uses: Swatinem/rust-cache@v2
57+
58+
- run: cargo clippy --all-targets --all-features

0 commit comments

Comments
 (0)