From f9bc24e1a7fa1cfc48456e995cfdd32e4cadac1f Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Thu, 31 Oct 2024 16:01:07 -0700 Subject: [PATCH] Add concurrency setting to codeql workflow (#22678) ### Description 1. Add concurrency setting to codeql workflow 2. Modify lint workflow's PATH setting. ### Motivation and Context To save machine resource. --- .github/workflows/codeql.yml | 4 ++++ .github/workflows/lint.yml | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d3b51c0681a20..d1dc717c2a9c9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -15,6 +15,10 @@ on: schedule: - cron: '41 13 * * 0' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: analyze: name: Analyze diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ec834b07b2c78..1f0425609e574 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,10 +49,15 @@ jobs: with: toolchain: stable components: rustfmt + - name: Update PATH + run: | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Install dependencies run: | - python -m pip install -r requirements-dev.txt - python -m pip install lintrunner lintrunner-adapters + set -e -x + python -m pip install --user -r requirements-dev.txt + python -m pip install --user lintrunner lintrunner-adapters lintrunner init - name: Run lintrunner on all files run: | @@ -81,8 +86,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master + - name: Update PATH + run: | + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Install ninja - run: python -m pip install --upgrade ninja + run: python -m pip install --user --upgrade ninja - name: Generate compile_commands.json run: | python tools/ci_build/build.py \