Files
semantica/examples/ci/github-actions.yml
T
KaifAhmad1 302d0a2d75 fix: address Qodo review findings on CI/release hardening
- setup-semantica action: pass extras/version through env vars instead
  of interpolating ${{ inputs.* }} directly into the bash script, which
  was a script-injection vector for any caller deriving these from
  event/matrix data
- install-matrix: trigger on the Release workflow's completion
  (workflow_run) instead of `release: published`, since the GitHub
  release is created before the PyPI upload runs - the old trigger
  could race the publish and silently verify the prior version; also
  assert the installed version matches the triggering release tag
- examples/ci/github-actions.yml: pin actions/checkout and
  actions/setup-python to the same verified commit SHAs used elsewhere
  in this repo instead of mutable v5/v6 tags, and document how to pin
  the setup-semantica@main reference for production use
- examples/ci templates + README: make the requirements.txt install
  step conditional (guard with `-f requirements.txt`) and call out
  pyproject.toml/Poetry/Pipenv as alternatives, since the templates
  previously assumed every project has a requirements.txt; CircleCI's
  cache key also no longer hashes a file that may not exist
2026-08-30 16:41:46 +05:30

45 lines
1.5 KiB
YAML

# Drop this in as .github/workflows/semantica.yml in your own project.
#
# Installs Semantica and runs a smoke import + your test suite. Swap the
# smoke-test step for whatever your project actually does with Semantica
# (build a context graph, run an ingest pipeline, etc.).
#
# Third-party actions below are pinned to a commit SHA rather than a mutable
# tag - a moved tag can silently swap in different code. Update the pin (and
# the trailing "# vX" comment) deliberately when you want a newer version;
# see semantica-agi/semantica's own .github/workflows/verify-action-pins.yml
# for one way to keep pins honest automatically.
name: Semantica
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install semantica
# Install your own project's dependencies however your project
# declares them - adjust this to match. Examples:
# pip install -r requirements.txt
# pip install -e . # pyproject.toml / setup.cfg
# pip install -e ".[dev]"
# poetry install
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run tests
run: pytest