commit
24c709e804
@ -1,37 +1,33 @@
|
||||
---
|
||||
name: "Init Environment"
|
||||
description: "Initialize environment for tests"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Checkout actions
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
installer-parallel: true
|
||||
|
||||
- name: Load cached venv
|
||||
id: cached-poetry-dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: .venv
|
||||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||
run: poetry install --no-interaction --no-root --with test --with dev --all-extras
|
||||
shell: bash
|
||||
|
||||
- name: Activate venv
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
echo PATH=$PATH >> $GITHUB_ENV
|
||||
shell: bash
|
||||
- name: Checkout actions
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install and configure Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
installer-parallel: true
|
||||
- name: Load cached venv
|
||||
id: cached-poetry-dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: .venv
|
||||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{hashFiles('**/poetry.lock') }}
|
||||
- name: Install dependencies
|
||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||
run: poetry install --no-interaction --no-root --with test --with dev --all-extras
|
||||
shell: bash
|
||||
- name: Activate venv
|
||||
run: |
|
||||
source .venv/bin/activate
|
||||
echo PATH=$PATH >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
@ -1,14 +1,34 @@
|
||||
---
|
||||
# this is a config file for the github action labeler
|
||||
|
||||
# Add 'label1' to any changes within 'example' folder or any subfolders
|
||||
example_change:
|
||||
- example/**
|
||||
|
||||
# Add 'label2' to any file changes within 'example2' folder
|
||||
example2_change: example2/*
|
||||
|
||||
# Add label3 to any change to .txt files within the entire repository.
|
||||
# Quotation marks are required for the leading asterisk
|
||||
text_files:
|
||||
- '**/*.txt'
|
||||
documentation:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: ["docs/**", "*.md"]
|
||||
tests:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "tests/**"
|
||||
agents:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "swarms/agents/**"
|
||||
artifacts:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "swarms/artifacts/**"
|
||||
memory:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "swarms/memory/**"
|
||||
models:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "swarms/models/**"
|
||||
prompts:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "swarms/prompts/**"
|
||||
structs:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "swarms/structs/**"
|
||||
telemetry:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "swarms/telemetry/**"
|
||||
tools:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "swarms/tools/**"
|
||||
utils:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file: "swarms/utils/**"
|
||||
|
@ -0,0 +1,25 @@
|
||||
name: autofix.ci
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: ["main"]
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
autofix:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
- run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest
|
||||
- run: yamlfmt .
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
- run: pip install ruff
|
||||
- run: ruff format .
|
||||
- run: ruff check --fix .
|
||||
|
||||
- uses: autofix-ci/action@d3e591514b99d0fca6779455ff8338516663f7cc
|
@ -1,27 +0,0 @@
|
||||
name: Run pytest
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# This will run the job every day at a random minute past the hour
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest
|
||||
pip install swarms
|
||||
|
||||
- name: Run tests
|
||||
run: pytest
|
@ -1,18 +1,16 @@
|
||||
name: readthedocs/actions
|
||||
name: Documentation Links
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
paths:
|
||||
- "docs/**"
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
pull-request-links:
|
||||
documentation-links:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: readthedocs/actions/preview@v1
|
||||
with:
|
||||
project-slug: swarms
|
||||
project-slug: "swarms"
|
@ -1,27 +1,33 @@
|
||||
|
||||
---
|
||||
name: Lint
|
||||
|
||||
on: [push, pull_request] # yamllint disable-line rule:truthy
|
||||
|
||||
on: [push, pull_request] # yamllint disable-line rule:truthy
|
||||
jobs:
|
||||
yaml-lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out source repository
|
||||
uses: actions/checkout@v4
|
||||
- name: yaml Lint
|
||||
uses: ibiqlik/action-yamllint@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- run: pip install yamllint
|
||||
- run: yamllint .
|
||||
flake8-lint:
|
||||
runs-on: ubuntu-latest
|
||||
name: flake8 Lint
|
||||
steps:
|
||||
- name: Check out source repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Python environment
|
||||
uses: py-actions/flake8@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- run: pip install flake8
|
||||
- run: flake8 .
|
||||
ruff-lint:
|
||||
runs-on: ubuntu-latest
|
||||
name: ruff Lint
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: chartboost/ruff-action@v1
|
||||
- uses: actions/setup-python@v5
|
||||
- run: pip install ruff
|
||||
- run: ruff format .
|
||||
- run: ruff check --fix .
|
||||
pylint-lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
- run: pip install pylint
|
||||
- run: pylint swarms --recursive=y
|
||||
|
@ -1,15 +0,0 @@
|
||||
name: "PR Labeler"
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: ["opened", "reopened", "ready_for_review"]
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/labeler@v5
|
||||
if: ${{ github.event.pull_request.draft == false }}
|
@ -1,30 +0,0 @@
|
||||
name: Pull Request Checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
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.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
pip install swarms
|
||||
pip install pytest
|
||||
|
||||
- name: Run tests and checks
|
||||
run: |
|
||||
pytest
|
||||
pylint swarms
|
@ -1,23 +0,0 @@
|
||||
name: Pylint
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.8", "3.9", "3.10"]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pylint
|
||||
- name: Analysing the code with pylint
|
||||
run: |
|
||||
pylint $(git ls-files '*.py')
|
@ -1,39 +0,0 @@
|
||||
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||
|
||||
name: Python application
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.10"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 pytest swarms
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest
|
@ -1,41 +0,0 @@
|
||||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||
|
||||
name: Python package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ["3.7", "3.9", "3.10", "3.11"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install --upgrade swarms
|
||||
python -m pip install flake8 pytest swarms
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest
|
@ -1,31 +0,0 @@
|
||||
name: Upload Python Package
|
||||
|
||||
on: # yamllint disable-line rule:truthy
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
@ -1,34 +0,0 @@
|
||||
name: Run Examples Script
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
schedule:
|
||||
# Runs at 3:00 AM UTC every day
|
||||
- cron: '0 3 * * *'
|
||||
|
||||
jobs:
|
||||
run-examples:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
# Assuming your script might also need pytest and swarms
|
||||
pip install pytest
|
||||
pip install swarms
|
||||
|
||||
- name: Make Script Executable and Run
|
||||
run: |
|
||||
chmod +x ./swarms/scripts/run_examples.sh
|
||||
./swarms/scripts/run_examples.sh
|
@ -1,27 +1,49 @@
|
||||
---
|
||||
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||
#
|
||||
# You can adjust the behavior by modifying this file.
|
||||
# For more information, see:
|
||||
# https://github.com/actions/stale
|
||||
name: Mark stale issues and pull requests
|
||||
|
||||
name: Stale
|
||||
on:
|
||||
schedule:
|
||||
- cron: '26 12 * * *'
|
||||
|
||||
# Scheduled to run at 1.30 UTC everyday
|
||||
- cron: "0 0 * * *"
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'Stale issue message'
|
||||
stale-pr-message: 'Stale pull request message'
|
||||
stale-issue-label: 'no-issue-activity'
|
||||
stale-pr-label: 'no-pr-activity'
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-issue-stale: 14
|
||||
days-before-issue-close: 14
|
||||
stale-issue-label: "status:stale"
|
||||
close-issue-reason: not_planned
|
||||
any-of-labels: "status:awaiting user response,status:more data needed"
|
||||
stale-issue-message: >
|
||||
Marking this issue as stale since it has been open for 14 days with no
|
||||
activity. This issue will be closed if no further activity occurs.
|
||||
|
||||
close-issue-message: >
|
||||
This issue was closed because it has been inactive for 28 days. Please
|
||||
post a new issue if you need further assistance. Thanks!
|
||||
|
||||
days-before-pr-stale: 14
|
||||
days-before-pr-close: 14
|
||||
stale-pr-label: "status:stale"
|
||||
stale-pr-message: >
|
||||
Marking this pull request as stale since it has been open for 14 days
|
||||
with no activity. This PR will be closed if no further activity occurs.
|
||||
|
||||
close-pr-message: >
|
||||
This pull request was closed because it has been inactive for 28 days.
|
||||
Please open a new pull request if you need further assistance. Thanks!
|
||||
|
||||
# Label that can be assigned to issues to exclude them from being marked as stale
|
||||
exempt-issue-labels: "override-stale"
|
||||
# Label that can be assigned to PRs to exclude them from being marked as stale
|
||||
exempt-pr-labels: "override-stale"
|
||||
|
@ -1,49 +0,0 @@
|
||||
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
|
||||
#
|
||||
# You can adjust the behavior by modifying this file.
|
||||
# For more information, see:
|
||||
# https://github.com/actions/stale
|
||||
name: Mark stale issues and pull requests
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Scheduled to run at 1.30 UTC everyday
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/stale@v9
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
days-before-issue-stale: 14
|
||||
days-before-issue-close: 14
|
||||
stale-issue-label: "status:stale"
|
||||
close-issue-reason: not_planned
|
||||
any-of-labels: "status:awaiting user response,status:more data needed"
|
||||
stale-issue-message: >
|
||||
Marking this issue as stale since it has been open for 14 days with no activity.
|
||||
This issue will be closed if no further activity occurs.
|
||||
close-issue-message: >
|
||||
This issue was closed because it has been inactive for 28 days.
|
||||
Please post a new issue if you need further assistance. Thanks!
|
||||
days-before-pr-stale: 14
|
||||
days-before-pr-close: 14
|
||||
stale-pr-label: "status:stale"
|
||||
stale-pr-message: >
|
||||
Marking this pull request as stale since it has been open for 14 days with no activity.
|
||||
This PR will be closed if no further activity occurs.
|
||||
close-pr-message: >
|
||||
This pull request was closed because it has been inactive for 28 days.
|
||||
Please open a new pull request if you need further assistance. Thanks!
|
||||
# Label that can be assigned to issues to exclude them from being marked as stale
|
||||
exempt-issue-labels: 'override-stale'
|
||||
# Label that can be assigned to PRs to exclude them from being marked as stale
|
||||
exempt-pr-labels: "override-stale"
|
||||
|
@ -1,110 +1,60 @@
|
||||
name: test
|
||||
|
||||
name: Tests
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
POETRY_VERSION: "1.4.2"
|
||||
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version:
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
test_type:
|
||||
- "core"
|
||||
- "extended"
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: "snok/install-poetry@v1"
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
poetry-version: "1.4.2"
|
||||
cache-key: ${{ matrix.test_type }}
|
||||
install-command:
|
||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
||||
echo "Running core tests, installing dependencies with poetry..."
|
||||
poetry install
|
||||
else
|
||||
echo "Running extended tests, installing dependencies with poetry..."
|
||||
poetry install -E extended_testing
|
||||
fi
|
||||
- name: Run ${{matrix.test_type}} tests
|
||||
- name: Install Python
|
||||
uses: actions/setup-python@v4
|
||||
- name: Install Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
- name: Setup a local virtual environment
|
||||
run: |
|
||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
||||
make test
|
||||
else
|
||||
make extended_tests
|
||||
fi
|
||||
shell: bash
|
||||
name: Python ${{ matrix.python-version }} ${{ matrix.test_type }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: "./.github/actions/poetry_setup"
|
||||
poetry config virtualenvs.create true --local
|
||||
poetry config virtualenvs.in-project true --local
|
||||
- uses: actions/cache@v3
|
||||
name: Define a cache for the virtual environment
|
||||
file
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
poetry-version: "1.4.2"
|
||||
cache-key: ${{ matrix.test_type }}
|
||||
install-command: |
|
||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
||||
echo "Running core tests, installing dependencies with poetry..."
|
||||
poetry install
|
||||
else
|
||||
echo "Running extended tests, installing dependencies with poetry..."
|
||||
poetry install -E extended_testing
|
||||
fi
|
||||
- name: Run ${{matrix.test_type}} tests
|
||||
run: |
|
||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
||||
make test
|
||||
else
|
||||
make extended_tests
|
||||
fi
|
||||
shell: bash
|
||||
build:
|
||||
path: ./.venv
|
||||
key: venv-${{ hashFiles('poetry.lock') }}
|
||||
- name: Install the project dependencies
|
||||
run: poetry install
|
||||
- name: Install OpenCV
|
||||
run: sudo apt-get install python3-opencv
|
||||
- name: Enter the virtual environment
|
||||
run: source $VENV
|
||||
- name: Run the tests
|
||||
run: poetry run pytest --verbose
|
||||
run-examples:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version:
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
test_type:
|
||||
- "core"
|
||||
- "extended"
|
||||
name: Python ${{ matrix.python-version }} ${{ matrix.test_type }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: "./.github/actions/poetry_setup"
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
poetry-version: "1.4.2"
|
||||
cache-key: ${{ matrix.test_type }}
|
||||
install-command: |
|
||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
||||
echo "Running core tests, installing dependencies with poetry..."
|
||||
poetry install
|
||||
else
|
||||
echo "Running extended tests, installing dependencies with poetry..."
|
||||
poetry install -E extended_testing
|
||||
fi
|
||||
- name: Run ${{matrix.test_type}} tests
|
||||
- name: Install Python
|
||||
uses: actions/setup-python@v4
|
||||
- name: Install Poetry
|
||||
uses: snok/install-poetry@v1
|
||||
- name: Setup a local virtual environment
|
||||
run: |
|
||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
||||
make test
|
||||
else
|
||||
make extended_tests
|
||||
fi
|
||||
shell: bash
|
||||
poetry config virtualenvs.create true --local
|
||||
poetry config virtualenvs.in-project true --local
|
||||
- uses: actions/cache@v3
|
||||
name: Define a cache for the virtual environment
|
||||
file
|
||||
with:
|
||||
path: ./.venv
|
||||
key: venv-${{ hashFiles('poetry.lock') }}
|
||||
- name: Install the project dependencies
|
||||
run: poetry install
|
||||
- name: Install OpenCV
|
||||
run: sudo apt-get install python3-opencv
|
||||
- name: Enter the virtual environment
|
||||
run: source $VENV
|
||||
- name: Make Script Executable and Run
|
||||
run: |-
|
||||
chmod +x ./scripts/run_examples.sh
|
||||
./scripts/run_examples.sh
|
||||
|
@ -1,81 +0,0 @@
|
||||
# Notebook-related checks
|
||||
|
||||
name: Presubmit checks
|
||||
|
||||
on:
|
||||
# Relevant PRs
|
||||
pull_request:
|
||||
paths:
|
||||
- "swarms/**"
|
||||
- "tests/**"
|
||||
# Allow manual runs
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test3_11:
|
||||
name: Test Py3.11
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Run tests
|
||||
run: |
|
||||
python --version
|
||||
pip install .[dev]
|
||||
python -m pytest
|
||||
test3_10:
|
||||
name: Test Py3.10
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Run tests
|
||||
run: |
|
||||
python --version
|
||||
pip install -q .[dev]
|
||||
python -m pytest
|
||||
test3_9:
|
||||
name: Test Py3.9
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
- name: Run tests
|
||||
run: |
|
||||
python --version
|
||||
pip install .[dev]
|
||||
python -m pytest
|
||||
pytype3_10:
|
||||
name: pytype 3.10
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Run pytype
|
||||
run: |
|
||||
python --version
|
||||
pip install .[dev]
|
||||
pip install -q gspread ipython
|
||||
pytype
|
||||
format:
|
||||
name: Check format with black
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- name: Check format
|
||||
run: |
|
||||
python --version
|
||||
pip install -q .
|
||||
pip install -q black
|
||||
black . --check
|
@ -1,27 +0,0 @@
|
||||
name: Unit Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
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.10"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
pip install pytest
|
||||
|
||||
- name: Run unit tests
|
||||
run: pytest
|
@ -1,36 +0,0 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
pip install pytest
|
||||
pip install swarms
|
||||
|
||||
- name: Run Python unit tests
|
||||
run: pytest
|
||||
|
||||
- name: Verify that the Docker image for the action builds
|
||||
run: docker build . --file Dockerfile
|
||||
|
||||
- name: Verify integration test results
|
||||
run: pytest
|
Loading…
Reference in new issue