Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/problem-matchers/yamllint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"problemMatcher": [
{
"owner": "yamllint",
"pattern": [
{
"regexp": "^(.*\\.ya?ml)$",
"file": 1
},
{
"regexp": "^\\s{2}(\\d+):(\\d+)\\s+(error|warning)\\s+(.*?)\\s+\\((.*)\\)$",
"line": 1,
"column": 2,
"severity": 3,
"message": 4,
"code": 5,
"loop": true
}
]
}
]
}
30 changes: 30 additions & 0 deletions .github/workflows/ci-file-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# https://github.com/tensorflow/quantum/actions/workflows/ci-file-checks.yaml
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

name: CI file checks

Check warning on line 15 in .github/workflows/ci-file-checks.yaml

View workflow job for this annotation

GitHub Actions / YAML lint

15:1 [document-start] missing document start "---"
run-name: Continuous integration file checks

on:

Check warning on line 18 in .github/workflows/ci-file-checks.yaml

View workflow job for this annotation

GitHub Actions / YAML lint

18:1 [truthy] truthy value should be one of [false, true]
pull_request:
types: [opened, synchronize]
branches:
Expand Down Expand Up @@ -79,6 +79,8 @@
python_files: ${{steps.filter.outputs.python_files}}
cc: ${{steps.filter.outputs.cc}}
cc_files: ${{steps.filter.outputs.cc_files}}
yaml: ${{steps.filter.outputs.yaml}}
yaml_files: ${{steps.filter.outputs.yaml_files}}
steps:
# When invoked manually, use the given SHA to figure out the change list.
- if: github.event_name == 'workflow_dispatch'
Expand Down Expand Up @@ -125,6 +127,10 @@
- '**/*.cc'
- '**/*.h'
- '**/*.proto'
yaml:
- added|modified:
- '**/*.yaml'
- '**/*.yml'

Setup:
if: needs.Changes.outputs.python == 'true'
Expand Down Expand Up @@ -336,3 +342,27 @@
} >> "$GITHUB_STEP_SUMMARY"
fi
exit $exit_code

Yaml-lint:
if: needs.Changes.outputs.yaml == 'true'
name: YAML lint
needs: Changes
runs-on: ubuntu-24.04
steps:
- name: Check out a copy of the TFQ git repository
uses: actions/checkout@v4

- name: Set up yamllint output problem matcher
run: echo '::add-matcher::.github/problem-matchers/yamllint.json'

- name: Find out the yamllint version
id: yamllint
run: |
version=$(yamllint --version)
echo "version=${version#yamllint }" >> "$GITHUB_OUTPUT"

- name: Run yamllint ${{steps.yamllint.outputs.version}}
run: |
set -x
# shellcheck disable=SC2086
yamllint --format github ${{needs.Changes.outputs.yaml_files}}
Loading