derive-rs 0.1.12

Rust SDK for Derive.xyz
name: CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  ci:
    runs-on: ubuntu-latest

    env:
      CARGO_TERM_COLOR: always

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install deps
        run: | 
          sudo apt-get update && \
          sudo apt-get install yq jq -y

      - uses: actions/setup-node@v4
        with:
          node-version: 22
          package-manager-cache: false


      - name: Install Redocly CLI
        run: npm install --global @redocly/cli@2.17.0

      - name: Install Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          toolchain: 1.94.1
          components: rustfmt, clippy

      - name: Machete
        uses: bnjbvr/cargo-machete@main

      - name: Cache cargo
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
          restore-keys: |
            ${{ runner.os }}-cargo-

      - name: Codegen
        run: make codegen

      - name: Format
        run: make fmt

      - name: Lint
        run: make lint

      - name: Check generated code is up to date
        run: git diff --exit-code

      - name: Build
        run: make build

      - name: Test
        run: make test