Skip to content

Commit f15a31a

Browse files
committed
feat: migrate to github actions
1 parent 2c522d4 commit f15a31a

File tree

2 files changed

+70
-32
lines changed

2 files changed

+70
-32
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- 'ft*'
8+
pull_request:
9+
branches:
10+
- master
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
15+
jobs:
16+
test:
17+
name: Build, Lint, and Test
18+
runs-on: ubuntu-latest
19+
container:
20+
image: rust:alpine
21+
steps:
22+
- name: Install Alpine dependencies
23+
run: apk add --no-cache git musl-dev
24+
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Install Rust components
29+
run: rustup component add clippy rustfmt
30+
31+
- name: Cache Cargo dependencies
32+
uses: actions/cache@v3
33+
with:
34+
path: |
35+
~/.cargo/bin/
36+
~/.cargo/registry/index/
37+
~/.cargo/registry/cache/
38+
~/.cargo/git/db/
39+
target/
40+
key: ${{ runner.os }}-alpine-cargo-${{ hashFiles('**/Cargo.lock') }}
41+
42+
- name: Check formatting
43+
run: cargo fmt -- --check
44+
45+
- name: Lint with Clippy
46+
run: cargo clippy -- -D warnings
47+
48+
- name: Run Tests
49+
run: cargo test --verbose
50+
51+
publish:
52+
name: Publish to Crates.io
53+
runs-on: ubuntu-latest
54+
needs: test
55+
environment: master
56+
if: github.ref == 'refs/heads/master'
57+
steps:
58+
- name: Checkout repository
59+
uses: actions/checkout@v4
60+
61+
- name: Install Rust toolchain
62+
uses: dtolnay/rust-toolchain@stable
63+
64+
- name: Build Release
65+
run: cargo build --release
66+
67+
- name: Publish to Crates.io
68+
env:
69+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
70+
run: cargo publish --token $CARGO_REGISTRY_TOKEN

.travis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)