name: Validate SCML files with sctrace

on:
  workflow_dispatch:
  pull_request:
    paths:
      - tools/sctrace/**
      - book/src/kernel/linux-compatibility/syscall-flag-coverage/**
      - .github/workflows/validate_scmls.yml
  push:
    branches:
      - main
    paths:
      - tools/sctrace/**
      - book/src/kernel/linux-compatibility/syscall-flag-coverage/**
      - .github/workflows/validate_scmls.yml

jobs:
  validate_scmls:
    runs-on: ubuntu-latest
    timeout-minutes: 10
    container: asterinas/asterinas:0.17.0-20251213
    steps:
      - uses: actions/checkout@v4
      - name: Validate SCML files with sctrace
        run: |
          export ASTER_SCML=$(find ./book/src/kernel/linux-compatibility/ -name "*.scml")
          ./tools/sctrace.sh $ASTER_SCML -- echo "Asterinas"
