Skip to content

Commit 9ccd38e

Browse files
authored
Merge pull request #16 from thrishank/ci
Add test job before publishing crate to crates.io
2 parents 9769b77 + 15e3654 commit 9ccd38e

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,35 @@ name: Publish Crate
33
on:
44
push:
55
tags:
6-
- 'v*.*.*'
6+
- "v*.*.*"
77
# Add this to allow manual triggering from GitHub UI
88
workflow_dispatch:
99

1010
jobs:
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repo code
16+
uses: actions/checkout@v4
17+
18+
- name: Install rust toolchain
19+
uses: dtolnay/rust-toolchain@stable
20+
21+
- name: Setup Rust Cache
22+
uses: Swatinem/rust-cache@v2
23+
24+
- name: Run Tests
25+
run: cd tests && cargo test
26+
1127
publish:
1228
name: Publish to crates.io
1329
runs-on: ubuntu-latest
30+
needs: [test]
1431
steps:
15-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
1633
with:
17-
fetch-depth: 0 # Get all history for tags
34+
fetch-depth: 0 # Get all history for tags
1835

1936
- name: Set up Rust
2037
uses: actions-rs/toolchain@v1
@@ -37,4 +54,5 @@ jobs:
3754
uses: katyo/publish-crates@v2
3855
with:
3956
registry-token: ${{ secrets.CRATES_IO_TOKEN }}
40-
path: './jup-ag-sdk'
57+
path: "./jup-ag-sdk"
58+

0 commit comments

Comments
 (0)