Skip to content

Commit

Permalink
Merge pull request #2 from vivax3794/Github-Actions
Browse files Browse the repository at this point in the history
Add github actions
  • Loading branch information
vivax3794 authored Nov 23, 2024
2 parents d455606 + 9e4bbfa commit ec1e471
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
workflow_dispatch:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install Rust
uses: actions/setup-rust@v1
with:
profile: minimal
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Run Tests
run: cargo test --all --verbose

lint:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install Rust
uses: actions/setup-rust@v1
with:
profile: minimal
toolchain: stable

- name: Install Clippy and Rustfmt
run: rustup component add clippy rustfmt

- uses: Swatinem/rust-cache@v2

- name: Check Formatting
run: cargo fmt --all -- --check

- name: Run Clippy
run: cargo clippy -

30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Crates

on:
workflow_dispatch:
push:
tags:
- 'v*'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install Rust
uses: actions/setup-rust@v1
with:
profile: minimal
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Publish Workspace
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo publish --workspace --token "$CARGO_REGISTRY_TOKEN"

0 comments on commit ec1e471

Please sign in to comment.