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

ci: add workflow_call to code analysis workflows #663

Merged
merged 9 commits into from
Mar 14, 2024
19 changes: 10 additions & 9 deletions .github/workflows/codacy-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ name: Codacy Security Scan
on:
schedule:
- cron: '59 11 27 * *'
# push:
# branches: [ "master" ]
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ "master" ]
workflow_run:
workflows: [Test Changes]
types:
- completed
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
types: [opened, reopened, synchronize, ready_for_review]
# workflow_run:
# workflows: [Test Changes]
# types:
# - completed
workflow_call:
workflow_dispatch:
inputs:
logLevel:
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ name: "CodeQL"
on:
schedule:
- cron: '59 10 27 * *'
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
workflow_run:
workflows: [Test Changes]
types:
- completed
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
types: [opened, reopened, synchronize, ready_for_review]
# workflow_run:
# workflows: [Test Changes]
# types:
# - completed
workflow_call:
workflow_dispatch:
inputs:
logLevel:
Expand Down
33 changes: 24 additions & 9 deletions .github/workflows/test-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
push:
branches: [ "master" ]
pull_request:
types: [opened, reopened, synchronize, ready_for_review] # labeled
branches: [ "master" ]
types: [opened, reopened, synchronize, ready_for_review]
workflow_dispatch:
inputs:
logLevel:
Expand All @@ -19,14 +20,6 @@
- info
- warning
- debug
# tags:
# description: 'Test scenario tags'
# required: false
# type: boolean
# environment:
# description: 'Environment to run tests against'
# type: environment
# required: true

jobs:
run-guard:
Expand Down Expand Up @@ -208,3 +201,25 @@
run: |
cd docs
sphinx-build -W -b singlehtml -d ../build/doctrees . ../build/singlehtml

# TODO: 1 configuration not found: https://docs.github.com/en/actions/using-workflows/reusing-workflows#overview
# call-workflow-codeql:
# needs: test-source-code
# uses: ./.github/workflows/codeql-analysis.yml
# permissions:
Dismissed Show dismissed Hide dismissed
# actions: read
# contents: read
# pull-requests: write
# security-events: write
# secrets: inherit # pass all secrets

# call-workflow-codacity:
# needs: test-source-code
# uses: ./.github/workflows/codacy-analysis.yml
# permissions:
# actions: read
# contents: read
# pull-requests: write
# security-events: write
# secrets: inherit # pass all secrets

21 changes: 10 additions & 11 deletions examples/notes/issue_219.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@

# <codecell>

import sys
sys.path.insert(0, '../src')
import petl; print petl.VERSION
from petl.fluent import etl
import psycopg2
import MySQLdb
import psycopg2

# <codecell>
import petl
from petl.fluent import etl

Check warning

Code scanning / Pylint (reported by Codacy)

No name 'fluent' in module 'petl' Warning

No name 'fluent' in module 'petl'

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

No name 'fluent' in module 'petl' Warning

No name 'fluent' in module 'petl'

# <codecell>
print(petl.VERSION)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Module 'petl' has no 'VERSION' member Warning

Module 'petl' has no 'VERSION' member

Check warning

Code scanning / Pylint (reported by Codacy)

Module 'petl' has no 'VERSION' member Warning

Module 'petl' has no 'VERSION' member
tbl_dummy_data = etl().dummytable(100000)
tbl_dummy_data.look()

# <codecell>

print tbl_dummy_data.nrows()
print(tbl_dummy_data.nrows())

# <headingcell level=2>

Expand All @@ -48,12 +47,12 @@
# <codecell>

# memory usage using default cursor
print etl.fromdb(psql_connection, 'select * from issue_219 order by foo').look(2)
print(etl.fromdb(psql_connection, 'select * from issue_219 order by foo').look(2))

# <codecell>

# memory usage using server-side cursor
print etl.fromdb(lambda: psql_connection.cursor(name='server-side'), 'select * from issue_219 order by foo').look(2)
print(etl.fromdb(lambda: psql_connection.cursor(name='server-side'), 'select * from issue_219 order by foo').look(2))
Dismissed Show dismissed Hide dismissed

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (117/100) Warning

Line too long (117/100)

# <headingcell level=2>

Expand All @@ -77,10 +76,10 @@
# <codecell>

# memory usage with default cursor
print etl.fromdb(mysql_connection, 'select * from issue_219 order by foo').look(2)
print(etl.fromdb(mysql_connection, 'select * from issue_219 order by foo').look(2))

# <codecell>

# memory usage with server-side cursor
print etl.fromdb(lambda: mysql_connection.cursor(MySQLdb.cursors.SSCursor), 'select * from issue_219 order by foo').look(2)
print(etl.fromdb(lambda: mysql_connection.cursor(MySQLdb.cursors.SSCursor), 'select * from issue_219 order by foo').look(2))

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (124/100) Warning

Line too long (124/100)

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (124/100) Warning

Line too long (124/100)

Loading