Team Ai
Apppublic

Underground-Digital/Workflow-Engine

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
style.yml126 linesDownload Raw Back to workflows
1name: Style check2 3on:4  pull_request:5    branches:6      - main7 8concurrency:9  group: style-${{ github.head_ref || github.run_id }}10  cancel-in-progress: true11 12jobs:13  python-style:14    name: Python Style15    runs-on: ubuntu-latest16 17    steps:18      - name: Checkout code19        uses: actions/checkout@v420 21      - name: Check changed files22        id: changed-files23        uses: tj-actions/changed-files@v4524        with:25          files: api/**26 27      - name: Install Poetry28        if: steps.changed-files.outputs.any_changed == 'true'29        uses: abatilo/actions-poetry@v330 31      - name: Set up Python32        uses: actions/setup-python@v533        if: steps.changed-files.outputs.any_changed == 'true'34        with:35          python-version: '3.10'36 37      - name: Python dependencies38        if: steps.changed-files.outputs.any_changed == 'true'39        run: poetry install -C api --only lint40 41      - name: Ruff check42        if: steps.changed-files.outputs.any_changed == 'true'43        run: poetry run -C api ruff check ./api44 45      - name: Dotenv check46        if: steps.changed-files.outputs.any_changed == 'true'47        run: poetry run -C api dotenv-linter ./api/.env.example ./web/.env.example48 49      - name: Ruff formatter check50        if: steps.changed-files.outputs.any_changed == 'true'51        run: poetry run -C api ruff format --check ./api52 53      - name: Lint hints54        if: failure()55        run: echo "Please run 'dev/reformat' to fix the fixable linting errors."56 57  web-style:58    name: Web Style59    runs-on: ubuntu-latest60    defaults:61      run:62        working-directory: ./web63 64    steps:65      - name: Checkout code66        uses: actions/checkout@v467 68      - name: Check changed files69        id: changed-files70        uses: tj-actions/changed-files@v4571        with:72          files: web/**73 74      - name: Setup NodeJS75        uses: actions/setup-node@v476        if: steps.changed-files.outputs.any_changed == 'true'77        with:78          node-version: 2079          cache: yarn80          cache-dependency-path: ./web/package.json81 82      - name: Web dependencies83        if: steps.changed-files.outputs.any_changed == 'true'84        run: yarn install --frozen-lockfile85 86      - name: Web style check87        if: steps.changed-files.outputs.any_changed == 'true'88        run: yarn run lint89 90 91  superlinter:92    name: SuperLinter93    runs-on: ubuntu-latest94 95    steps:96      - name: Checkout code97        uses: actions/checkout@v498 99      - name: Check changed files100        id: changed-files101        uses: tj-actions/changed-files@v45102        with:103          files: |104            **.sh105            **.yaml106            **.yml107            **Dockerfile108            dev/**109 110      - name: Super-linter111        uses: super-linter/super-linter/slim@v7112        if: steps.changed-files.outputs.any_changed == 'true'113        env:114          BASH_SEVERITY: warning115          DEFAULT_BRANCH: main116          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}117          IGNORE_GENERATED_FILES: true118          IGNORE_GITIGNORED_FILES: true119          VALIDATE_BASH: true120          VALIDATE_BASH_EXEC: true121          # FIXME: temporarily disabled until api-docker.yaml's run script is fixed for shellcheck122          # VALIDATE_GITHUB_ACTIONS: true123          VALIDATE_DOCKERFILE_HADOLINT: true124          VALIDATE_XML: true125          VALIDATE_YAML: true126