Skip to content

Create requirements.txt #28

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

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
50 changes: 50 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "CodeQL Analysis"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: python

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform analysis
uses: github/codeql-action/analyze@v1
with:
# Path to the main CodeQL query file for your analysis
# Replace the example query path with your own query path.
query: .github/codeql/myquery.ql

# Path to the CodeQL database that the analysis should use
# By default, the database is stored in the workspace directory.
# If you specify a different path, make sure the directory exists.
database: ${{ github.workspace }}/codeql-database

# Path to the CodeQL CLI executable (optional)
# If not specified, the default CodeQL CLI executable will be used.
#cli: /path/to/codeql-cli

- name: Upload SARIF results
uses: github/codeql-action/upload-sarif@v1
with:
# Path to the SARIF file that contains the analysis results
# This should match the output file specified in your CodeQL query.
# Replace the example SARIF path with your own SARIF path.
sarif_file: codeql-results.sarif
18 changes: 18 additions & 0 deletions .github/workflows/checkfaiza.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Push Event Workflow
on: push

jobs:
unit-testing:
runs-on: ubuntu-latest

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

- name: install Package
run: pip install pytest

- name: Run tests
run: pytest test.py


10 changes: 10 additions & 0 deletions codeql/myquery.ql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import python

from CallExpr call, Function f
where call.getTarget().toString() = "odd_sum" and
call.getEnclosingFunction() = f
select f, call


where f.getName() = "odd_sum"
select f
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
numpy==1.19.4
pandas==1.1.5
matplotlib==3.3.2
scikit-learn==0.23.2
10 changes: 10 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from Math.odd_sum import odd_sum
from Math.prime_factors import prime_factors

def test_odd():
assert odd_sum(1,3)==4

def test_prime():
assert prime_factors(50)==[2,5,5]