Skip to content

Commit

Permalink
added ci
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Oct 24, 2024
1 parent fd5f387 commit 36aa39d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI Rust testing

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build_and_test:
name: Rust project - latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Rust
run: rustup update stable && rustup default stable
- name: Build
run: cargo build --verbose
- name: Test
run: cargo test --verbose

publish:
name: Publish to crates.io
needs: build_and_test
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
run: rustup update stable && rustup default stable
- name: Publish to crates.io
run: cargo publish --verbose --locked --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 36aa39d

Please sign in to comment.