-
Notifications
You must be signed in to change notification settings - Fork 23
Maja's GHA for running tests in CI #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Check BeeAI agents in container | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| check-in-container: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - target: check-agents-in-container | ||
| - target: check-mcp-server-in-container | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Podman | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y podman | ||
| podman --version | ||
| - name: Build test image from Containerfile.tests | ||
| run: | | ||
| podman build --rm --tag beeai-tests -f Containerfile.tests ./beeai | ||
| - name: Run ${{ matrix.target }} target | ||
| env: | ||
| CONTAINER_ENGINE: podman | ||
| TEST_IMAGE: beeai-tests | ||
| working-directory: beeai/ | ||
| run: make ${{ matrix.target }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,13 +7,17 @@ CONTAINER_ENGINE ?= $(shell command -v podman 2>/dev/null || echo "docker") | |
| build-test-image: | ||
| $(CONTAINER_ENGINE) build --rm --tag $(TEST_IMAGE) -f Containerfile.tests | ||
|
|
||
| .PHONY: check | ||
| check: | ||
| .PHONY: check check-agents check-mcp-server check-in-container check-agents-in-container check-mcp-server-in-container | ||
| check-agents: | ||
| cd ./agents && \ | ||
| PYTHONPATH=$(CURDIR) PYTHONDONTWRITEBYTECODE=1 python3 -m pytest --verbose --showlocals $(TEST_TARGET) || true | ||
| PYTHONPATH=$(CURDIR) PYTHONDONTWRITEBYTECODE=1 python3 -m pytest --verbose --showlocals $(TEST_TARGET) | ||
| check-mcp-server: | ||
| cd ./mcp_server && \ | ||
| PYTHONPATH=$(CURDIR) PYTHONDONTWRITEBYTECODE=1 python3 -m pytest --verbose --showlocals $(TEST_TARGET) | ||
| check: check-agents check-mcp-server | ||
|
|
||
| .PHONY: check-in-container | ||
| check-in-container: | ||
| $(CONTAINER_ENGINE) run --rm -it -v $(CURDIR):/src:z --env TEST_TARGET $(TEST_IMAGE) make -f Makefile.tests check | ||
| check-agents-in-container: | ||
| $(CONTAINER_ENGINE) run --rm -it -v $(CURDIR):/src:z --env TEST_TARGET $(TEST_IMAGE) make -f Makefile.tests check-agents | ||
| check-mcp-server-in-container: | ||
| $(CONTAINER_ENGINE) run --rm -it -v $(CURDIR):/src:z --env TEST_TARGET $(TEST_IMAGE) make -f Makefile.tests check-mcp-server | ||
|
Comment on lines
+20
to
+22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nah, we get colors with these flags |
||
| check-in-container: check-agents-in-container check-mcp-server-in-container | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These
git configcommands will fail because thegitcommand-line tool is not installed in the container. Thednf installcommand on lines 4-14 is missing thegit-corepackage. This will cause the container build to fail. Please addgit-coreto the list of packages to be installed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are partially right but one of the packages brings it as a dep