parent
1aebbe0777
commit
faedd6b858
@ -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,39 +1,35 @@
|
||||
---
|
||||
# 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" ]
|
||||
branches: ["master"]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
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
|
||||
- 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 +1,38 @@
|
||||
---
|
||||
# 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" ]
|
||||
branches: ["master"]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
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
|
||||
- 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,27 +1,24 @@
|
||||
---
|
||||
# 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:
|
||||
- cron: '26 12 * * *'
|
||||
|
||||
- cron: '26 12 * * *'
|
||||
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 }}
|
||||
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'
|
||||
|
@ -1,49 +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
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Scheduled to run at 1.30 UTC everyday
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
# 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"
|
||||
- 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,81 +1,80 @@
|
||||
---
|
||||
# Notebook-related checks
|
||||
|
||||
name: Presubmit checks
|
||||
|
||||
on:
|
||||
# Relevant PRs
|
||||
pull_request:
|
||||
paths:
|
||||
- "swarms/**"
|
||||
- "tests/**"
|
||||
- "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
|
||||
- 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
|
||||
- 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
|
||||
- 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
|
||||
- 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
|
||||
- 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 +1,22 @@
|
||||
---
|
||||
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 +1,27 @@
|
||||
---
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
|
||||
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
|
||||
- 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
|
||||
|
@ -1,18 +1,19 @@
|
||||
---
|
||||
repos:
|
||||
- repo: https://github.com/ambv/black
|
||||
rev: 22.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
- id: black
|
||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||
rev: 'v0.0.255'
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: [----unsafe-fixes]
|
||||
args: ['----unsafe-fixes']
|
||||
- repo: https://github.com/nbQA-dev/nbQA
|
||||
rev: 1.6.3
|
||||
hooks:
|
||||
- id: nbqa-black
|
||||
additional_dependencies: [ipython==8.12, black]
|
||||
- id: nbqa-ruff
|
||||
args: ["--ignore=I001"]
|
||||
additional_dependencies: [ipython==8.12, ruff]
|
||||
- id: nbqa-black
|
||||
additional_dependencies: [ipython==8.12, black]
|
||||
- id: nbqa-ruff
|
||||
args: ["--ignore=I001"]
|
||||
additional_dependencies: [ipython==8.12, ruff]
|
||||
|
@ -1,13 +1,11 @@
|
||||
---
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3.11"
|
||||
|
||||
mkdocs:
|
||||
configuration: mkdocs.yml
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: requirements.txt
|
||||
install:
|
||||
- requirements: requirements.txt
|
||||
|
Loading…
Reference in new issue