build: bump pkg to v0.8.0 (#124) #728
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 on push or internal PR | |
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} | |
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: Create .env file on fork PR | |
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} | |
uses: SpicyPizza/[email protected] | |
- name: Build | |
uses: docker/bake-action@v5 | |
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 on push or internal PR | |
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} | |
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: Create .env file on fork PR | |
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} | |
uses: SpicyPizza/[email protected] | |
- name: Load Image | |
uses: docker/bake-action@v5 | |
with: | |
load: true | |
set: | | |
*.cache-from=type=gha | |
*.cache-to=type=gha,mode=max | |
targets: dynamiq-app-test | |
- name: Run tests on push or internal PR | |
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} | |
run: docker compose up dynamiq-app-test-cov --exit-code-from dynamiq-app-test-cov | |
- name: Run tests on fork PR | |
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} | |
run: docker compose up dynamiq-app-test-cov-exclude-integration-with-creds --exit-code-from dynamiq-app-test-cov-exclude-integration-with-creds | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_report | |
path: ./reports | |
coverage: | |
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} | |
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 on push or internal PR | |
uses: MishaKav/pytest-coverage-comment@main | |
with: | |
pytest-xml-coverage-path: ./reports/coverage.xml | |
junitxml-path: ./reports/test-results.xml | |
report-only-changed-files: true | |
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 |