parent
ee4cc086da
commit
6179211762
@ -1,14 +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,104 +1,25 @@
|
|||||||
---
|
name: Tests
|
||||||
name: test
|
on: [push]
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [master]
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
env:
|
|
||||||
POETRY_VERSION: "1.4.2"
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
python-version:
|
|
||||||
- "3.8"
|
|
||||||
- "3.9"
|
|
||||||
- "3.10"
|
|
||||||
- "3.11"
|
|
||||||
test_type:
|
|
||||||
- "core"
|
|
||||||
- "extended"
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v2
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Install Python
|
||||||
uses: "snok/install-poetry@v1"
|
uses: actions/setup-python@v4
|
||||||
with:
|
- name: Install Poetry
|
||||||
python-version: ${{ matrix.python-version }}
|
uses: snok/install-poetry@v1
|
||||||
poetry-version: "1.4.2"
|
- name: Setup a local virtual environment
|
||||||
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: |
|
run: |
|
||||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
poetry config virtualenvs.create true --local
|
||||||
make test
|
poetry config virtualenvs.in-project true --local
|
||||||
else
|
- uses: actions/cache@v3
|
||||||
make extended_tests
|
name: Define a cache for the virtual environment
|
||||||
fi
|
file
|
||||||
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"
|
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
path: ./.venv
|
||||||
poetry-version: "1.4.2"
|
key: venv-${{ hashFiles('poetry.lock') }}
|
||||||
cache-key: ${{ matrix.test_type }}
|
- name: Install the project dependencies
|
||||||
install-command: |
|
run: poetry install
|
||||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
- name: Run the tests
|
||||||
echo "Running core tests, installing dependencies with poetry..."
|
run: poetry run pytest
|
||||||
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:
|
|
||||||
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
|
|
||||||
run: |
|
|
||||||
if [ "${{ matrix.test_type }}" == "core" ]; then
|
|
||||||
make test
|
|
||||||
else
|
|
||||||
make extended_tests
|
|
||||||
fi
|
|
||||||
shell: bash
|
|
||||||
|
@ -1,80 +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,22 +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,27 +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