Skip to content

entrypoint for rcc-server added #3

entrypoint for rcc-server added

entrypoint for rcc-server added #3

# Commits in feature branches will run linting and testing jobs.
# PRs targeting the main branch will run the full pre-PR checks.
name: pre_pr_checks
on:
push:
branches:
- '**' # Runs on all branches (for commits)
pull_request:
branches:
- main # Runs on PRs targeting the main branch
jobs:
# Linting job runs on all branches (including feature branches)
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12'] # '3.10', '3.11',
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Run linting
run: |
pre-commit run --all-files --verbose --show-diff-on-failure
# Testing job runs on all branches (including feature branches)
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Run tests with coverage
run: |
pytest
# Secrets scanning job runs only on PRs targeting main
secrets-scanning:
name: Checking for Secrets
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Secret Scanner
uses: secret-scanner/[email protected]
# Vulnerability scanning job runs only on PRs targeting main
# vulnerability-scanning:
# name: CodeQL Vulnerability Scan
# runs-on: ubuntu-latest
# if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Initialize CodeQL
# uses: github/codeql-action/init@v3
# with:
# languages: python
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.x'
# - name: Install dependencies and build project
# run: |
# python -m pip install --upgrade pip
# python -m pip install build hatch
# python -m build --wheel --outdir dist
# pip install dist/*.whl
# - name: Perform CodeQL Analysis
# uses: github/codeql-action/analyze@v3
# Full Pre-PR checks (runs only on PRs targeting main)
pre-pr-checks:
runs-on: ubuntu-latest
needs: [lint, test, secrets-scanning, ] # vulnerability-scanning
if: github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main'
steps:
- name: Notify Success
run: echo "All pre-PR checks passed successfully."