Skip to content

Commit

Permalink
ci: Add GitHub workflows for building and publishing
Browse files Browse the repository at this point in the history
Add a workflow that builds, tests and runs lint checks on the crate.

Add a workflow for publishing the crate to `crates.io`
when a new git tag is pushed.
  • Loading branch information
ravenexp committed Oct 11, 2023
1 parent 2dcba62 commit fcc4879
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish crates

on:
push:
tags: [ v* ]

env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

jobs:
publish-crate:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run cargo publish
run: cargo publish
35 changes: 35 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Rust build checks

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
fmt:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run cargo fmt
run: cargo fmt -- --check
clippy:
name: Clippy lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run cargo clippy
run: cargo clippy --tests -- --deny warnings

0 comments on commit fcc4879

Please sign in to comment.