-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Anurag Rajawat <[email protected]>
- Loading branch information
1 parent
1149f91
commit 84931da
Showing
5 changed files
with
153 additions
and
218 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,78 @@ | ||
name: ci-test-py | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
py-pip-ai-sentryflow: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
|
||
- name: check Python pip3 requirements | ||
run: | | ||
pip install -r requirements.txt | ||
working-directory: ai-engine | ||
|
||
py-ruff-ai-sentryflow: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
working-directory: ai-engine | ||
|
||
- name: Create pyproject.toml | ||
run: | | ||
echo "[tool.ruff.lint.per-file-ignores]" > pyproject.toml | ||
echo '"stringlifier/*" = ["E402", "F811", "F401"]' >> pyproject.toml | ||
working-directory: ai-engine | ||
|
||
- name: Lint with Ruff | ||
run: | | ||
pip install ruff | ||
ruff --output-format=github . | ||
working-directory: ai-engine | ||
|
||
py-lint-ai-sentryflow: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install pylint | ||
working-directory: ai-engine | ||
|
||
- name: Lint with Pylint | ||
run: | | ||
pylint classifier.py | ||
working-directory: ai-engine | ||
|
||
py-pep8-ai-sentryflow: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: 'Run PEP8' | ||
uses: quentinguidee/pep8-action@v1 | ||
with: | ||
arguments: '--max-line-length=120 --exclude=*stringlifier/*,*protobuf/*' | ||
#name: ci-test-py | ||
#on: | ||
# push: | ||
# branches: [main] | ||
# pull_request: | ||
# branches: [main] | ||
# | ||
#jobs: | ||
# py-pip-ai-sentryflow: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: '3.11' | ||
# cache: 'pip' | ||
# | ||
# - name: check Python pip3 requirements | ||
# run: | | ||
# pip install -r requirements.txt | ||
# working-directory: ai-engine | ||
# | ||
# py-ruff-ai-sentryflow: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: '3.11' | ||
# cache: 'pip' | ||
# | ||
# - name: Install dependencies | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install -r requirements.txt | ||
# working-directory: ai-engine | ||
# | ||
# - name: Create pyproject.toml | ||
# run: | | ||
# echo "[tool.ruff.lint.per-file-ignores]" > pyproject.toml | ||
# echo '"stringlifier/*" = ["E402", "F811", "F401"]' >> pyproject.toml | ||
# working-directory: ai-engine | ||
# | ||
# - name: Lint with Ruff | ||
# run: | | ||
# pip install ruff | ||
# ruff --output-format=github . | ||
# working-directory: ai-engine | ||
# | ||
# py-lint-ai-sentryflow: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: '3.11' | ||
# cache: 'pip' | ||
# | ||
# - name: Install dependencies | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install -r requirements.txt | ||
# pip install pylint | ||
# working-directory: ai-engine | ||
# | ||
# - name: Lint with Pylint | ||
# run: | | ||
# pylint classifier.py | ||
# working-directory: ai-engine | ||
# | ||
# py-pep8-ai-sentryflow: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: 'Run PEP8' | ||
# uses: quentinguidee/pep8-action@v1 | ||
# with: | ||
# arguments: '--max-line-length=120 --exclude=*stringlifier/*,*protobuf/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright 2024 Authors of SentryFlow | ||
|
||
name: PR checks | ||
|
||
on: | ||
pull_request: | ||
types: [ opened, reopened, synchronize, ready_for_review ] | ||
paths-ignore: | ||
- '**.md' | ||
- 'docs/**' | ||
- 'LICENSE' | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
license: | ||
name: License | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./sentryflow | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Check License Header | ||
uses: apache/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
static-checks: | ||
name: Static checks | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./sentryflow | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22' | ||
|
||
- name: go fmt | ||
run: make fmt | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
working-directory: ./sentryflow | ||
version: v1.60.3 | ||
args: --timeout=10m --out-format=line-number | ||
skip-cache: true # https://github.com/golangci/golangci-lint-action/issues/244#issuecomment-1052197778 | ||
|
||
build-sentryflow-image: | ||
name: Build SentryFlow container image | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
defaults: | ||
run: | ||
working-directory: ./sentryflow | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build image | ||
run: make image | ||
|
||
- name: Scan image | ||
uses: anchore/scan-action@v4 | ||
with: | ||
image: "docker.io/5gsec/sentryflow:latest" | ||
severity-cutoff: critical | ||
output-format: sarif |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.