compose title for processing status results (#1769) #2861
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: nucliadb Standalone (py) | |
env: | |
COMPONENT: nucliadb-standalone | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/nucliadb_standalone.yml" | |
- "charts/nucliadb/**" | |
- "nucliadb/nucliadb/ingest/**" | |
- "nucliadb/nucliadb/writer/**" | |
- "nucliadb/nucliadb/standalone/**" | |
- "nucliadb/nucliadb/reader/**" | |
- "nucliadb/nucliadb/search/**" | |
- "nucliadb_models/**" | |
- "nucliadb_protos/**" | |
- "nucliadb_node/**" | |
- "nucliadb_vectors/**" | |
- "nucliadb_texts/**" | |
- "nucliadb_texts2/**" | |
- "nucliadb_paragraphs/**" | |
- "nucliadb_core/**" | |
- "nucliadb_relations/**" | |
- 'nucliadb_relations2/**' | |
push: | |
branches: | |
- main | |
paths: | |
- ".github/workflows/nucliadb_standalone.yml" | |
- "charts/nucliadb/**" | |
- "nucliadb/nucliadb/ingest/**" | |
- "nucliadb/nucliadb/writer/**" | |
- "nucliadb/nucliadb/standalone/**" | |
- "nucliadb/nucliadb/reader/**" | |
- "nucliadb/nucliadb/search/**" | |
- "nucliadb_models/**" | |
- "nucliadb_protos/**" | |
jobs: | |
# Job to run pre-checks | |
pre-checks: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install package | |
run: make -C nucliadb/ install-dev | |
- name: Run pre-checks | |
run: make -C nucliadb/ lint-standalone | |
# Job to run tests | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
# Setup gcloud CLI | |
- uses: google-github-actions/auth@v1 | |
with: | |
project_id: "${{ secrets.PROJECT_ID }}" | |
credentials_json: "${{ secrets.GCP_CREDENTIALS }}" | |
- name: "Set up Cloud SDK" | |
uses: "google-github-actions/setup-gcloud@v1" | |
# setup docker, as we need to pull the node image to run the tests | |
- name: Configure Docker | |
run: docker login -u oauth2accesstoken -p "$(gcloud auth application-default print-access-token)" https://eu.gcr.io | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install the package | |
run: make -C nucliadb/ install-dev | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
node_modified: | |
- 'nucliadb_core/**' | |
- 'nucliadb_node/src/**' | |
- 'nucliadb_paragraphs/**' | |
- 'nucliadb_procs/**' | |
- 'nucliadb_relations/**' | |
- 'nucliadb_relations2/**' | |
- 'nucliadb_telemetry/**' | |
- 'nucliadb_texts/**' | |
- 'nucliadb_vectors/**' | |
sidecar_modified: | |
- 'nucliadb_node/nucliadb_node/**' | |
- name: Calc git info | |
id: git | |
run: |- | |
BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | |
echo "branch=$BRANCH" >> $GITHUB_OUTPUT | |
- name: Install jq | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y jq | |
- name: Build local Node for testing | |
if: steps.filter.outputs.node_modified == 'true' | |
env: | |
SECRET_KEY: ${{ secrets.RUST_BUILD_SERVER_SECRET }} | |
COMMIT_HASH: ${{ github.event.pull_request.head.sha || github.sha }} | |
BRANCH: ${{ steps.git.outputs.branch }} | |
run: | | |
make build-node-debug | |
- name: Build local Sidecar for testing | |
if: steps.filter.outputs.sidecar_modified == 'true' | |
run: | | |
make build-sidecar | |
- name: Run tests | |
run: | | |
pytest -rfE --cov=nucliadb.standalone -s --tb=native -v --cov-report xml --cov-append nucliadb/nucliadb/standalone | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
flags: standalone |