diff --git a/.github/actions/pre_commit/action.yaml b/.github/actions/pre_commit/action.yaml deleted file mode 100644 index 376b31ffc1013..0000000000000 --- a/.github/actions/pre_commit/action.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: pre-commit -description: Runs pre-commit -inputs: - base_ref: - description: "Ref to run from" - required: true -runs: - using: "composite" - steps: - - run: python -m pip install pre-commit - shell: bash - - run: python -m pip freeze --local - shell: bash - - uses: actions/cache@v3 - with: - path: ~/.cache/pre-commit - key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} - - run: pre-commit run --show-diff-on-failure --color=always --all-files - shell: bash diff --git a/.github/config/android-arm.json b/.github/config/android-arm.json index a6a2067b5af0b..d683ba4a4f366 100644 --- a/.github/config/android-arm.json +++ b/.github/config/android-arm.json @@ -1,4 +1,3 @@ - { "docker_service": "linux", "platforms": [ diff --git a/.github/config/android-chrobalt-arm.json b/.github/config/android-chrobalt-arm.json index 93cf80c5da6d9..5d356a390d983 100644 --- a/.github/config/android-chrobalt-arm.json +++ b/.github/config/android-chrobalt-arm.json @@ -1,4 +1,3 @@ - { "docker_service": "linux", "platforms": [ diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000000000..0b42d7fe311ef --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,51 @@ +name: lint + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + branches: + - main + - feature/* + push: + branches: + - main + - feature/* + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ inputs.platform }} @ ${{ github.event.label.name || github.event.pull_request.number || github.sha }} @ ${{ github.event.label.name && github.event.pull_request.number || github.event.action }} + cancel-in-progress: true + +permissions: {} + +jobs: + lint: + name: Pre-Commit + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Install pre-commit + run: | + sudo apt update + sudo apt update + sudo apt install python3 gn pre-commit + pre-commit --version + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Run pre-commit + run: | + pre-commit install --hook-type pre-commit --hook-type pre-push + pre-commit run --show-diff-on-failure --color=always --from-ref ${{ github.event.pull_request.base.sha && github.event.pull_request.base.sha || github.event.before }} --to-ref HEAD + check-bug-id: + name: Bug ID Check + runs-on: ubuntu-latest + steps: + - name: Bug ID Check + # v2 + uses: gsactions/commit-message-checker@16fa2d5de096ae0d35626443bcd24f1e756cafee + with: + accessToken: ${{ secrets.GITHUB_TOKEN }} + pattern: '(b\/\d+|^(Bug|Fixed|Issue): \d+$|(partnerissuetracker\.corp|issuetracker)\.google\.com\/u\/\d+\/issues\/\d+$)' + flags: 'gm' + error: 'PR title or description should include at least one bug ID.' diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0e7b9cbd2672f..33eaede3d8b99 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -39,10 +39,8 @@ jobs: ) timeout-minutes: 10 steps: - - name: Checkout files + - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 1 - name: Remove runtest if exists if: github.event_name == 'pull_request' continue-on-error: true # Ignore this step if we cannot remove the label. @@ -85,10 +83,8 @@ jobs: needs: [initialize] runs-on: [self-hosted, chrobalt-linux-runner] steps: - - name: Checkout files + - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 1 # Handle GitHub registry used for everything other than pull requests off forked repos. - name: Login to GitHub Docker Registry if: ${{ (github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == github.repository) }}