added CI documentation file #12
This file contains 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: Trunk Check | |
# Define permissions explicitly | |
permissions: | |
# Only read access needed for most operations | |
contents: read | |
# Needed for trunk to post annotations | |
checks: write | |
# Needed for caching | |
actions: read | |
on: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
trunk-check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- name: Cache Trunk | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/trunk | |
key: trunk-${{ runner.os }}-${{ hashFiles('.trunk/trunk.yaml') }} | |
restore-keys: | | |
trunk-${{ runner.os }}- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e ".[dev]" | |
- name: Trunk Check | |
# Pin to specific commit hash for security | |
uses: trunk-io/trunk-action@29a6c9b6e5ef0f7638917208ec3b46ea43646b43 # v1.1.0 | |
with: | |
check-mode: all | |
arguments: check | |
github-annotate: notice | |
- name: Run pre-commit checks | |
run: | | |
pre-commit run --all-files | |
- name: Run linters | |
run: | | |
make lint |