From e6a17e691bb7b00bd84f87f3ea795cae5bb9454a Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Thu, 23 Jan 2025 06:33:31 -0500 Subject: [PATCH 1/3] Add GitHub workflow to run code linting checks daily and on every push or pull request. --- .github/workflows/code-linting-checks.yaml | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/code-linting-checks.yaml diff --git a/.github/workflows/code-linting-checks.yaml b/.github/workflows/code-linting-checks.yaml new file mode 100644 index 00000000..52600836 --- /dev/null +++ b/.github/workflows/code-linting-checks.yaml @@ -0,0 +1,53 @@ +name: "code-linting-checks" + +on: + pull_request: + push: + schedule: + # Run daily at 00:15 UTC (the 15 is to avoid periods of high load) + - cron: "15 0 * * *" + workflow_dispatch: + +permissions: {} + +concurrency: + group: "${{github.workflow}}-${{github.ref}}" + + # Cancel in-progress jobs for efficiency + cancel-in-progress: true + +jobs: + lint-check: + strategy: + matrix: + os: ["macos-latest", "ubuntu-latest"] + runs-on: "${{matrix.os}}" + steps: + - uses: "actions/checkout@v4" + with: + submodules: "recursive" + + - uses: "actions/setup-python@v5" + with: + # NOTE: We resolve some of clang-tidy's IWYU violations using CPython 3.10's headers, so + # we need to use the same version of Python when running clang-tidy. + python-version: "3.10" + + - name: "Install task" + shell: "bash" + run: "npm install -g @go-task/cli" + + - name: "Log tool versions" + run: |- + md5sum --version + python --version + tar --version + task --version + + - if: "matrix.os == 'macos-latest'" + name: "Install coreutils (for md5sum)" + run: "brew install coreutils" + + - name: "Run lint task" + shell: "bash" + run: "task lint:check" From dccabcf393a096e96c211a96f7fc64277b2b13a3 Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Thu, 23 Jan 2025 06:57:21 -0500 Subject: [PATCH 2/3] Reorder jobs due to inter-dependencies --- .github/workflows/code-linting-checks.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code-linting-checks.yaml b/.github/workflows/code-linting-checks.yaml index 52600836..84282475 100644 --- a/.github/workflows/code-linting-checks.yaml +++ b/.github/workflows/code-linting-checks.yaml @@ -37,6 +37,10 @@ jobs: shell: "bash" run: "npm install -g @go-task/cli" + - if: "matrix.os == 'macos-latest'" + name: "Install coreutils (for md5sum)" + run: "brew install coreutils" + - name: "Log tool versions" run: |- md5sum --version @@ -44,10 +48,6 @@ jobs: tar --version task --version - - if: "matrix.os == 'macos-latest'" - name: "Install coreutils (for md5sum)" - run: "brew install coreutils" - - name: "Run lint task" shell: "bash" run: "task lint:check" From 2da7a6f3ee50d3b6ba61ca38c06277495aff745e Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Thu, 23 Jan 2025 15:57:37 -0500 Subject: [PATCH 3/3] Match python version with clp --- .github/workflows/code-linting-checks.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/code-linting-checks.yaml b/.github/workflows/code-linting-checks.yaml index 84282475..ae7670bb 100644 --- a/.github/workflows/code-linting-checks.yaml +++ b/.github/workflows/code-linting-checks.yaml @@ -29,9 +29,7 @@ jobs: - uses: "actions/setup-python@v5" with: - # NOTE: We resolve some of clang-tidy's IWYU violations using CPython 3.10's headers, so - # we need to use the same version of Python when running clang-tidy. - python-version: "3.10" + python-version: "3.11" - name: "Install task" shell: "bash"