Skip to content

馃殌 Add read-only release notes mode #83

馃殌 Add read-only release notes mode

馃殌 Add read-only release notes mode #83

Workflow file for this run

name: Tests-and-Linters
permissions:
contents: read
on:
pull_request:
branches:
- master
jobs:
check-branch-name:
name: Check git branch name
runs-on: ubuntu-slim
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
ref: ${{ github.head_ref }}
- name: Make script executable
run: chmod +x .linters/check_git_branch_name.sh
- name: Run branch name check
run: .linters/check_git_branch_name.sh
test:
needs: check-branch-name
runs-on: ubuntu-slim
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867
- name: Create virtual environment
run: uv venv
- name: Restore cache uv
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cache/uv
.venv
key: uv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
uv-${{ runner.os }}-${{ matrix.python-version }}-
- name: Install dependencies
run: |
uv sync --dev
- name: Create CAI config and tokens
run: |
mkdir -p /home/runner/.config/cai /home/runner/work/.config/cai
cp .github/ci/cai_config.ci.yml /home/runner/.config/cai/cai_config.yml
cp .github/ci/cai_config.ci.yml /home/runner/work/.config/cai/cai_config.yml
cp .github/ci/tokens.ci.yml /home/runner/.config/cai/tokens.yml
cp .github/ci/tokens.ci.yml /home/runner/work/.config/cai/tokens.yml
- name: Run tests
run: |
uv run pytest
megalinter:
name: MegaLinter
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Generate version file
run: cp .github/ci/_version.py "$GITHUB_WORKSPACE/src/git_cai_cli/_version.py"
# MegaLinter
- name: MegaLinter
uses: oxsecurity/megalinter@42bb470545e359597e7f12156947c436e4e3fb9a
id: ml
env:
VALIDATE_ALL_CODEBASE: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload MegaLinter artifacts
- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: MegaLinter reports
include-hidden-files: "true"
path: |
megalinter-reports
mega-linter.log