Skip to content

CI

CI #88

Workflow file for this run

name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
- name: lint
run: cargo clippy
- name: check format
run: cargo fmt --check
- name: test
run: cargo test
test-build-image:
if: "!startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build Docker image
uses: docker/build-push-action@v4
with:
context: .
push: false
release:
name: Publish on crates.io
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [test]
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Publish on crates.io
run: |
cargo login ${{ secrets.CRATES_TOKEN }}
cargo publish