name: "Mixed linter and checks"

on:
  push:
  pull_request:
  
jobs:
  cmd_descs_yaml_check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install tools
        run: sudo apt-get install yamllint python3-yaml
      - name: Check YamlLint
        run: |
          yamllint -d "{rules: {line-length: {max: 120}}}" ./librz/core/cmd_descs.yaml
      - name: Check sync between yaml and C/H files
        run: |
          ./librz/core/cmd_descs_generate.py --output-dir /tmp ./librz/core/cmd_descs.yaml
          diff /tmp/cmd_descs.c ./librz/core/cmd_descs.c && diff /tmp/cmd_descs.h ./librz/core/cmd_descs.h