fix: run simple nodes in process pool (#6) #40
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Create .env file | |
uses: SpicyPizza/[email protected] | |
with: | |
envkey_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
envkey_UNSTRUCTURED_API_KEY: ${{ secrets.UNSTRUCTURED_API_KEY }} | |
envkey_PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | |
envkey_PINECONE_CLOUD: ${{ secrets.PINECONE_CLOUD }} | |
envkey_PINECONE_REGION: ${{ secrets.PINECONE_REGION }} | |
- name: Build | |
uses: docker/bake-action@v4 | |
with: | |
set: | | |
*.cache-from=type=gha | |
*.cache-to=type=gha,mode=max | |
targets: dynamiq-app | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Run pre-commit | |
uses: pre-commit/[email protected] | |
with: | |
extra_args: --all-files --show-diff-on-failure --color always | |
env: | |
SKIP: 'no-commit-to-branch' | |
- name: Run conventional commits checker | |
uses: opensource-nepal/[email protected] | |
test: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Create .env file | |
uses: SpicyPizza/[email protected] | |
with: | |
envkey_OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
envkey_UNSTRUCTURED_API_KEY: ${{ secrets.UNSTRUCTURED_API_KEY }} | |
envkey_PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }} | |
envkey_PINECONE_CLOUD: ${{ secrets.PINECONE_CLOUD }} | |
envkey_PINECONE_REGION: ${{ secrets.PINECONE_REGION }} | |
- name: Load Image | |
uses: docker/bake-action@v4 | |
with: | |
load: true | |
set: | | |
*.cache-from=type=gha | |
*.cache-to=type=gha,mode=max | |
targets: dynamiq-app-test | |
- name: Test | |
run: docker compose up dynamiq-app-test-cov --exit-code-from dynamiq-app-test-cov | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_report | |
path: ./reports | |
coverage: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
checks: write | |
pull-requests: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: coverage_report | |
path: reports | |
- name: Produce the coverage report | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
pytest-xml-coverage-path: ./reports/coverage.xml | |
junitxml-path: ./reports/test-results.xml | |
create-new-comment: false | |
build-mkdocs: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
version: 1.8.3 | |
virtualenvs-create: false | |
- name: Install dependencies | |
run: make install-dependencies-dev | |
- name: Build MkDocs | |
run: make build-mkdocs | |
publish-updated-mkdocs: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: build-mkdocs | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
version: 1.8.3 | |
virtualenvs-create: false | |
- name: Install dependencies | |
run: make install-dependencies-dev | |
- name: Publish Updated MkDocs | |
run: make publish-mkdocs |