parent
b9b750767c
commit
f0c4dfc811
@ -1,37 +1,38 @@
|
|||||||
|
---
|
||||||
name: "Init Environment"
|
name: "Init Environment"
|
||||||
description: "Initialize environment for tests"
|
description: "Initialize environment for tests"
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout actions
|
- name: Checkout actions
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Install and configure Poetry
|
- name: Install and configure Poetry
|
||||||
uses: snok/install-poetry@v1
|
uses: snok/install-poetry@v1
|
||||||
with:
|
with:
|
||||||
virtualenvs-create: true
|
virtualenvs-create: true
|
||||||
virtualenvs-in-project: true
|
virtualenvs-in-project: true
|
||||||
installer-parallel: true
|
installer-parallel: true
|
||||||
|
|
||||||
- name: Load cached venv
|
- name: Load cached venv
|
||||||
id: cached-poetry-dependencies
|
id: cached-poetry-dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: .venv
|
path: .venv
|
||||||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||||
run: poetry install --no-interaction --no-root --with test --with dev --all-extras
|
run: poetry install --no-interaction --no-root --with test --with dev --all-extras
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Activate venv
|
- name: Activate venv
|
||||||
run: |
|
run: |
|
||||||
source .venv/bin/activate
|
source .venv/bin/activate
|
||||||
echo PATH=$PATH >> $GITHUB_ENV
|
echo PATH=$PATH >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -1,36 +1,35 @@
|
|||||||
|
---
|
||||||
name: build
|
name: build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.9'
|
python-version: "3.9"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pytest
|
pip install pytest
|
||||||
pip install swarms
|
pip install swarms
|
||||||
|
|
||||||
- name: Run Python unit tests
|
- name: Run Python unit tests
|
||||||
run: pytest
|
run: pytest
|
||||||
|
|
||||||
- name: Verify that the Docker image for the action builds
|
- name: Verify that the Docker image for the action builds
|
||||||
run: docker build . --file Dockerfile
|
run: docker build . --file Dockerfile
|
||||||
|
|
||||||
- name: Verify integration test results
|
- name: Verify integration test results
|
||||||
run: pytest
|
run: pytest
|
||||||
|
@ -1,18 +1,19 @@
|
|||||||
|
---
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/ambv/black
|
- repo: https://github.com/ambv/black
|
||||||
rev: 22.3.0
|
rev: 22.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
rev: 'v0.0.255'
|
rev: "v0.0.255"
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [----unsafe-fixes]
|
args: [----unsafe-fixes]
|
||||||
- repo: https://github.com/nbQA-dev/nbQA
|
- repo: https://github.com/nbQA-dev/nbQA
|
||||||
rev: 1.6.3
|
rev: 1.6.3
|
||||||
hooks:
|
hooks:
|
||||||
- id: nbqa-black
|
- id: nbqa-black
|
||||||
additional_dependencies: [ipython==8.12, black]
|
additional_dependencies: [ipython==8.12, black]
|
||||||
- id: nbqa-ruff
|
- id: nbqa-ruff
|
||||||
args: ["--ignore=I001"]
|
args: ["--ignore=I001"]
|
||||||
additional_dependencies: [ipython==8.12, ruff]
|
additional_dependencies: [ipython==8.12, ruff]
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
extends: default
|
||||||
|
|
||||||
|
rules:
|
||||||
|
line-length:
|
||||||
|
max: 127
|
||||||
|
truthy:
|
||||||
|
# GitHub Actions
|
||||||
|
check-keys: false
|
Loading…
Reference in new issue