Skip to content

Commit

Permalink
quality control
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Oct 7, 2023
1 parent bffa6f8 commit 575c8cc
Show file tree
Hide file tree
Showing 19 changed files with 278 additions and 121 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/code_quality_control.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Linting and Formatting

on:
push:
branches:
- main

jobs:
lint_and_format:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x

- name: Install dependencies
run: pip install -r requirements.txt

- name: Find Python files
run: find swarms_torch -name "*.py" -type f -exec autopep8 --in-place --aggressive --aggressive {} +

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/cos_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Continuous Integration

on:
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x

- name: Install dependencies
run: pip install -r requirements.txt

- name: Run unit tests
run: pytest tests/unit

- name: Run integration tests
run: pytest tests/integration

- name: Run code coverage
run: pytest --cov=swarms tests/

- name: Run linters
run: pylint swarms

- name: Build documentation
run: make docs

- name: Validate documentation
run: sphinx-build -b linkcheck docs build/docs

- name: Run performance tests
run: pytest tests/performance
28 changes: 28 additions & 0 deletions .github/workflows/docs_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Documentation Tests

on:
push:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x

- name: Install dependencies
run: pip install -r requirements.txt

- name: Build documentation
run: make docs

- name: Validate documentation
run: sphinx-build -b linkcheck docs build/docs
25 changes: 25 additions & 0 deletions .github/workflows/lints.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Linting

on:
push:
branches:
- master

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x

- name: Install dependencies
run: pip install -r requirements.txt

- name: Run linters
run: pylint swarms_torch
27 changes: 27 additions & 0 deletions .github/workflows/pr_request_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Pull Request Checks

on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x

- name: Install dependencies
run: pip install -r requirements.txt

- name: Run tests and checks
run: |
pytest tests/
pylint swarms_torch
43 changes: 0 additions & 43 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pull-request-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: zeta
project-slug: swarms_torch
4 changes: 2 additions & 2 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
uses: pypa/gh-action-pypi-publish@f8c70e705ffc13c3b4d1221169b84f12a75d6ca8
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Quality

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout actions
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run linter
run: |
pylint `git diff --name-only --diff-filter=d origin/main HEAD | grep -E '\.py$' | tr '\n' ' '`
8 changes: 8 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Ruff
on: [ push, pull_request ]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
23 changes: 23 additions & 0 deletions .github/workflows/run_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Python application test

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run tests with pytest
run: |
pytest tests/
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
pull-requests: write

steps:
- uses: actions/stale@v5
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- "extended"
name: Python ${{ matrix.python-version }} ${{ matrix.test_type }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: "./.github/actions/poetry_setup"
with:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Unit Tests

on:
push:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x

- name: Install dependencies
run: pip install -r requirements.txt

- name: Run unit tests
run: pytest tests/
Loading

0 comments on commit 575c8cc

Please sign in to comment.