Improve generated cmake files verification and update lint.sh (#11381)

diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index f9e5639..0d4c89c 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -142,16 +142,12 @@
     steps:
       - name: Checking out repository
         uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0
-      - name: Generates E2E test artifacts cmake files
+      - name: Generating CMake files
         run: |
-          ./build_tools/testing/generate_cmake_e2e_test_artifacts_suite.py \
-            --output_dir ./tests/e2e/test_artifacts
-      - name: Generates E2E model test cmake files
-        run: |
-          ./build_tools/testing/generate_cmake_e2e_model_tests.py \
-            --output ./tests/e2e/models/generated_e2e_model_tests.cmake
+          ./build_tools/scripts/generate_cmake_files.sh
       - name: Checking Diff
         run: |
-          # Make sure to pick up new files that have been added.
+          # Make sure to run build_tools/scripts/generate_cmake_files.sh and
+          # pick up new files that have been added.
           git add -A
           git diff HEAD --exit-code
diff --git a/build_tools/scripts/generate_cmake_files.sh b/build_tools/scripts/generate_cmake_files.sh
new file mode 100755
index 0000000..acd5357
--- /dev/null
+++ b/build_tools/scripts/generate_cmake_files.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Copyright 2022 The IREE Authors
+#
+# Licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+# Run all CMake file generators with proper output paths.
+
+set -euo pipefail
+
+ROOT_DIR=$(git rev-parse --show-toplevel)
+cd "${ROOT_DIR}"
+
+./build_tools/testing/generate_cmake_e2e_test_artifacts_suite.py \
+  --output_dir ./tests/e2e/test_artifacts
+
+./build_tools/testing/generate_cmake_e2e_model_tests.py \
+  --output ./tests/e2e/models/generated_e2e_model_tests.cmake
diff --git a/build_tools/scripts/lint.sh b/build_tools/scripts/lint.sh
index ebab0dd..803798b 100755
--- a/build_tools/scripts/lint.sh
+++ b/build_tools/scripts/lint.sh
@@ -123,6 +123,11 @@
 echo "***** Path Lengths *****"
 ./build_tools/scripts/check_path_lengths.py
 
+echo "***** Generates CMake files *****"
+./build_tools/scripts/generate_cmake_files.sh
+git add -A
+git diff HEAD --exit-code
+
 if (( "${FINAL_RET}" != 0 )); then
   echo "Encountered failures. Check error messages and changes to the working" \
        "directory and git index (which may contain fixes) and try again."
diff --git a/tests/e2e/test_artifacts/README.md b/tests/e2e/test_artifacts/README.md
index 8a4b638..c5c4abf 100644
--- a/tests/e2e/test_artifacts/README.md
+++ b/tests/e2e/test_artifacts/README.md
@@ -12,8 +12,7 @@
 files with the command below:
 
 ```sh
-build_tools/testing/generate_cmake_e2e_test_artifacts_suite.py \
-  --output_dir tests/e2e/test_artifacts
+build_tools/scripts/generate_cmake_files.sh
 ```
 
 Here are the places to find the definitions of the artifacts: