zk-cli 0.1.0

A note-taking tool based on the famous Zettelkasten method
name: CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

defaults:
  run:
    shell: bash

jobs:
  all:
    name: All

    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest]

    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4

      - name: Download actionlint
        id: actionlint
        run:
          bash <(curl -sSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)

      - name: Check workflow
        run: ${{ steps.actionlint.outputs.executable }} -color

      - name: Install rust toolchain components
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt
          toolchain: stable

      - uses: Swatinem/rust-cache@v2

      - name: Info
        run: |
          rustup --version
          cargo --version
          cargo clippy --version

      - name: Install ripgrep
        run: |
          if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
            sudo apt-get update
            sudo apt-get install -y ripgrep
          else
            brew install ripgrep
          fi

      - name: Forbid
        run: |
          ./bin/forbid

      - name: Build
        run: cargo build

      - name: Lockfile
        run: cargo update --locked --package zk-cli

      - name: Lint
        run: cargo clippy --all-targets --all-features

      - name: Format
        run: cargo fmt --all -- --check

      - name: Test
        run: cargo test -- --test-threads 1