Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflows #1

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: 'Bug:'
labels: bug
assignees: ''
---

**Describe the bug**
Provide a clear and concise description of the bug.

**How to reproduce**
Include source code:

```python
from fastagency import FastAgency
...
```

And/Or steps to reproduce the behavior:

1. ...

**Expected behavior**
Explain what you expected to happen clearly and concisely.

**Observed behavior**
Describe what is actually happening clearly and concisely.

**Screenshots**
If applicable, attach screenshots to help illustrate the problem.

**Environment**
Include the output of the `fastagency -v` command to display your current project and system environment.

**Additional context**
Provide any other relevant context or information about the problem here.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true

contact_links:
- name: Security Contact
about: Please report security vulnerabilities to [email protected]
- name: Question or Problem
about: Ask a question or ask about a problem in GitHub Discussions.
url: https://github.com/airtai/fastagency/discussions/categories/questions
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Feature Request
about: Suggest an idea for this project
title: 'Feature:'
labels: enhancement
assignees: ''
---

To suggest an idea or inquire about a new Message Broker supporting feature or any other enhancement, please follow this template:

**Is your feature request related to a problem? Please describe.**
Provide a clear and concise description of the problem you've encountered. For example: "I'm always frustrated when..."

**Describe the solution you'd like**
Clearly and concisely describe the desired outcome or solution.

**Feature code example**
To help others understand the proposed feature, illustrate it with a **FastAgency** code example:

```python
from fastagency import FastAgency
...
```

**Describe alternatives you've considered**
Provide a clear and concise description of any alternative solutions or features you've thought about.

**Additional context**
Include any other relevant context or screenshots related to the feature request.
26 changes: 26 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Description

Please include a summary of the change and specify which issue is being addressed. Additionally, provide relevant motivation and context.

Fixes # (issue number)

## Type of change

Please delete options that are not relevant.

- [ ] Documentation (typos, code examples, or any documentation updates)
- [ ] Bug fix (a non-breaking change that resolves an issue)
- [ ] New feature (a non-breaking change that adds functionality)
- [ ] Breaking change (a fix or feature that would disrupt existing functionality)
- [ ] This change requires a documentation update

## Checklist

- [ ] My code adheres to the style guidelines of this project (`scripts/lint.sh` shows no errors)
- [ ] I have conducted a self-review of my own code
- [ ] I have made the necessary changes to the documentation
- [ ] My changes do not generate any new warnings
- [ ] I have added tests to validate the effectiveness of my fix or the functionality of my new feature
- [ ] Both new and existing unit tests pass successfully on my local environment by running `scripts/test-cov.sh`
- [ ] I have ensured that static analysis tests are passing by running `scripts/static-anaylysis.sh`
- [ ] I have included code examples to illustrate the modifications
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# Python
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
# Pnpm
- package-ecosystem: "pnpm"
kumaranvpl marked this conversation as resolved.
Show resolved Hide resolved
directory: "/auth_callout"
schedule:
interval: "weekly"
19 changes: 19 additions & 0 deletions .github/workflows/check-broken-links-in-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check docs for broken links

on:
workflow_run:
workflows: ["pages-build-deployment"]
types: [completed]

jobs:
check-broken-link:
name: Check docs for broken links
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Check links using container
uses: ruzickap/action-my-broken-link-checker@v2
with:
url: https://fastagency.airt.ai
kumaranvpl marked this conversation as resolved.
Show resolved Hide resolved
cmd_params: '--buffer-size=8192 --max-connections=1 --color=always --header="User-Agent:Mozilla/5.0(Firefox/97.0)" --exclude="(localhost:8000|linkedin.com|fonts.gstatic.com|reddit.com)" --max-connections-per-host=1 --rate-limit=1'
debug: true
60 changes: 60 additions & 0 deletions .github/workflows/check-certs-expiry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Check letsencrypt certs expiry

on:
# everyday at 00:00
schedule:
- cron: "0 0 * * *"
# or manually
workflow_dispatch:

jobs:
check-certs-expiry:
name: Check letsencrypt certs expiry
strategy:
fail-fast: false
matrix:
domain:
[
"fastagency.ai",
kumaranvpl marked this conversation as resolved.
Show resolved Hide resolved
"staging.fastagency.ai",
"api.fastagency.ai",
"api.staging.fastagency.ai",
"weather.tools.fastagency.ai",
"weather.tools.staging.fastagency.ai",
"monitoring.fastagency.ai",
]
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
container:
image: ubuntu:22.04
environment:
# Use staging if staging in matrix.domain else use production
name: ${{ contains(matrix.domain, 'staging') && 'staging' || 'production' }}
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
steps:
- uses: actions/checkout@v3
# This is to fix GIT not liking owner of the checkout dir - https://github.com/actions/runner/issues/2033#issuecomment-1204205989
- run: chown -R $(id -u):$(id -g) $PWD

- run: echo "PATH=$PATH:/github/home/.local/bin" >> $GITHUB_ENV
- run: "which ssh-agent || ( apt-get update -y && apt-get install openssh-client git -y )"
- run: apt-get update -y && apt-get install sshpass -y
- run: eval $(ssh-agent -s)
- run: mkdir -p ~/.ssh
- run: chmod 700 ~/.ssh

- run: echo "DOMAIN=${{ matrix.domain }}" >> $GITHUB_ENV

- run: ssh-keyscan "$DOMAIN" >> ~/.ssh/known_hosts
- run: chmod 644 ~/.ssh/known_hosts

- run: echo "$SSH_KEY" | base64 --decode > key.pem
- run: chmod 600 key.pem

- run: ssh -o StrictHostKeyChecking=no -i key.pem azureuser@"$DOMAIN" "ls -la"
- run: bash ./scripts/ci-check-certs.sh

- run: rm key.pem
83 changes: 83 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '39 20 * * 0'

jobs:
analyze:
if: github.event.pull_request.draft == false
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' 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 # nosemgrep
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


# 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 # nosemgrep

# ℹ️ 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 # nosemgrep
with:
category: "/language:${{matrix.language}}"
21 changes: 21 additions & 0 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
43 changes: 43 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy Docs
on:
push:
branches:
- main
paths:
- docs/**
- .github/workflows/deploy-docs.yaml
- fastagency/__about__.py

permissions:
contents: write
jobs:
deploy_docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- run: pip install -e ".[dev]"
- run: ./scripts/build-docs.sh
- run: echo "VERSION=$(python3 -c 'from importlib.metadata import version; print(".".join(version("fastagency").split(".")[:2]))')" >> $GITHUB_ENV
- run: echo "IS_RC=$(python3 -c 'from importlib.metadata import version; print("rc" in version("fastagency"))')" >> $GITHUB_ENV
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- run: echo $VERSION
- run: echo $IS_RC
- run: |
if [ "$IS_RC" == "False" ]; then
cd docs && mike deploy -F mkdocs.yml --update-aliases $VERSION latest
mike set-default --push --allow-empty -F mkdocs.yml latest
else
cd docs && mike deploy --push -F mkdocs.yml --update-aliases $VERSION
fi
Loading
Loading