Skip to content

Commit 35f3e84

Browse files
committed
Setup actions for CI and deployment.
1 parent d32c598 commit 35f3e84

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
branches: [ development ]
6+
pull_request:
7+
branches: [ master, development ]
8+
9+
jobs:
10+
run-tests:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
toolchain: [stable]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Install ${{ matrix.toolchain }}
22+
uses: dtolnay/rust-toolchain@master
23+
with:
24+
toolchain: ${{ matrix.toolchain }}
25+
26+
- name: Run tests
27+
run: cargo test

.github/workflows/deploy.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Deploy to Crates IO
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger the workflow when a tag starting with 'v' is pushed, like v1.0.0
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v5
15+
16+
- name: Setup Rust
17+
uses: actions-rust-lang/setup-rust-toolchain@v1
18+
with:
19+
toolchain: stable
20+
21+
- name: Deploy to Crates IO
22+
run: |
23+
cargo publish \
24+
--token ${{ secrets.CRATES_IO_TOKEN }}

0 commit comments

Comments
 (0)