chore(deps): update github/codeql-action action to v4 #266
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python CI | |
| on: | |
| push: | |
| branches: [develop] | |
| paths: | |
| - ".github/actions/python/**" | |
| - ".github/workflows/python-ci.yml" | |
| - "scripts/emoji_generator/**" | |
| pull_request: | |
| branches: [develop] | |
| paths: | |
| - ".github/actions/python/**" | |
| - ".github/workflows/python-ci.yml" | |
| - "scripts/emoji_generator/**" | |
| env: | |
| PYTHONUNBUFFERED: 1 | |
| WORKSPACE: ./scripts/emoji_generator | |
| jobs: | |
| dependency-review: | |
| name: Dependency Review | |
| if: >- | |
| github.event_name == 'pull_request' || | |
| github.event_name == 'pull_request_target' || | |
| github.event_name == 'merge_group' | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ${{ env.WORKSPACE }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: "Dependency Review" | |
| uses: actions/dependency-review-action@v4 | |
| with: | |
| comment-summary-in-pr: on-failure | |
| fail-on-severity: moderate | |
| analyze: | |
| name: CodeQL Analysis | |
| needs: dependency-review | |
| if: ${{ always() && needs.dependency-review.result != 'failure' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ${{ env.WORKSPACE }} | |
| permissions: | |
| actions: read | |
| contents: read | |
| security-events: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4 | |
| with: | |
| languages: python | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v4 | |
| lint-check: | |
| name: Lint Check | |
| needs: dependency-review | |
| if: ${{ always() && needs.dependency-review.result != 'failure' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ${{ env.WORKSPACE }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Common setup | |
| uses: ./.github/actions/python | |
| with: | |
| workspace: ${{ env.WORKSPACE }} | |
| - name: Run linter (Ruff) | |
| run: poetry run ruff check . | |
| format-check: | |
| name: Format Check | |
| needs: dependency-review | |
| if: ${{ always() && needs.dependency-review.result != 'failure' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ${{ env.WORKSPACE }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Common setup | |
| uses: ./.github/actions/python | |
| with: | |
| workspace: ${{ env.WORKSPACE }} | |
| - name: Check code formatting (Ruff) | |
| run: poetry run ruff format --check . | |
| type-check: | |
| name: Type Check | |
| needs: dependency-review | |
| if: ${{ always() && needs.dependency-review.result != 'failure' }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ${{ env.WORKSPACE }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Common setup | |
| uses: ./.github/actions/python | |
| with: | |
| workspace: ${{ env.WORKSPACE }} | |
| - name: Run type checker (mypy) | |
| run: poetry run mypy . | |
| test: | |
| name: Python Tests | |
| needs: [analyze, lint-check, format-check, type-check] | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ${{ env.WORKSPACE }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Common setup | |
| uses: ./.github/actions/python | |
| with: | |
| workspace: ${{ env.WORKSPACE }} | |
| - name: Run tests | |
| run: poetry run pytest -v |