Skip to content

Commit

Permalink
Merge pull request #395 from kyegomez/revert-388-fix-ci-2
Browse files Browse the repository at this point in the history
Revert "[WIP] Get CI Passing V2"
  • Loading branch information
kyegomez authored Feb 29, 2024
2 parents ff29a6b + 415a5cf commit 3b4dd64
Show file tree
Hide file tree
Showing 85 changed files with 1,007 additions and 6,803 deletions.
11 changes: 0 additions & 11 deletions .flake8

This file was deleted.

1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
# These are supported funding model platforms

github: [kyegomez]
# patreon: # Replace with a single Patreon username
# open_collective: # Replace with a single Open Collective username
Expand Down
37 changes: 37 additions & 0 deletions .github/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "pip"
directory: "/"
schedule:
Expand Down
64 changes: 13 additions & 51 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,14 @@
---
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/**"
chunkers:
- changed-files:
- any-glob-to-any-file: "swarms/chunkers/**"
cli:
- changed-files:
- any-glob-to-any-file: "swarms/cli/**"
loaders:
- changed-files:
- any-glob-to-any-file: "swarms/loaders/**"
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/**"
tokenizers:
- changed-files:
- any-glob-to-any-file: "swarms/tokenizers/**"
tools:
- changed-files:
- any-glob-to-any-file: "swarms/tools/**"
utils:
- changed-files:
- any-glob-to-any-file: "swarms/utils/**"
workers:
- changed-files:
- any-glob-to-any-file: "swarms/workers/**"
rust:
- changed-files:
- any-glob-to-any-file: "**/*.rs"
# 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'
44 changes: 0 additions & 44 deletions .github/library/setup/action.yml

This file was deleted.

22 changes: 15 additions & 7 deletions .github/workflows/RELEASE.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
---
name: release

on:
pull_request:
types:
- closed
branches:
- master
paths:
- "pyproject.toml"
- 'pyproject.toml'

env:
POETRY_VERSION: "1.4.2"

jobs:
if_release:
if: |
${{ github.event.pull_request.merged == true }}
&& ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
${{ github.event.pull_request.merged == true }}
&& ${{ contains(github.event.pull_request.labels.*.name, 'release') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/library/setup
- name: Install poetry
run: pipx install poetry==$POETRY_VERSION
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "poetry"
- name: Build project for distribution
run: poetry build
- name: Check Version
Expand All @@ -37,5 +45,5 @@ jobs:
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}
run: |-
poetry publish
run: |
poetry publish
23 changes: 12 additions & 11 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
Expand All @@ -11,38 +10,39 @@
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.

name: Codacy Security Scan

on:
push:
branches: ["master"]
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
branches: [ "master" ]
schedule:
- cron: '18 23 * * 4'

permissions:
contents: read

jobs:
codacy-security-scan:
permissions:
# for actions/checkout to fetch code
contents: read
# for github/codeql-action/upload-sarif to upload SARIF results
security-events: write
# only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
actions: read
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v4

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@33d455949345bddfdb845fba76b57b70cc83754b
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token
# to get your project token from your Codacy repository
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
Expand All @@ -53,6 +53,7 @@ jobs:
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v3
Expand Down
70 changes: 39 additions & 31 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
Expand All @@ -11,14 +10,16 @@
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: ["master"]
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
branches: [ "master" ]
schedule:
- cron: '33 12 * * 5'

jobs:
analyze:
name: Analyze
Expand All @@ -33,42 +34,49 @@ jobs:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['python']
language: [ 'python' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
# For more details on CodeQL's query packs, refer to:
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

uses: github/codeql-action/autobuild@v3
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
Loading

0 comments on commit 3b4dd64

Please sign in to comment.