Skip to content
Merged
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
83 changes: 41 additions & 42 deletions .github/workflows/python-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,54 @@ name: Python Build & Test

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

permissions:
contents: write

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade black pyright

- name: Run Tests
run: |
python -m unittest discover -v -s ./tests -p test_*.py

- name: End-2-end Tests
env:
GITHUB_TOKEN: ${{ secrets.CODEQL_TOKEN }}
run: |
./gh-codeql-summarize \
-i ./examples/projects.json \
-f bundle \
-o ./examples \
--disable-banner

# Pull Request auto-linting
- name: Lint
if: github.event_name == 'pull_request'
run: |
black .

- name: Linting Commit Update
if: github.event_name == 'pull_request'
run: |
git config --global user.name 'Git bot'
git config --global user.email 'bot@noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Auto Linting Code using Black" && git push || echo "No changes to commit"


- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
run: |
pip install pipenv
pipenv install --dev

- name: Run Tests
run: |
pipenv run tests

- name: End-2-end Tests
env:
GITHUB_TOKEN: ${{ secrets.CODEQL_TOKEN }}
run: |
pipenv run main \
-i ./examples/projects.json \
-f bundle \
-o ./examples \
--disable-banner

# Pull Request auto-linting
- name: Lint
if: github.event_name == 'pull_request'
run: |
pipenv run lint

- name: Linting Commit Update
if: github.event_name == 'pull_request'
run: |
git config --global user.name 'Git bot'
git config --global user.email 'bot@noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "Auto Linting Code using Black" && git push || echo "No changes to commit"
8 changes: 4 additions & 4 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
pyyaml = "*"

[dev-packages]
black = "*"
pyright = "*"
Expand All @@ -11,10 +14,7 @@ pyright = "*"
python_version = "3.10"

[scripts]
main = "python3 codeqlsummurize/__main__.py"
main = "python3 -m codeqlsummarize"
lint = "black ."
format = "black ."
tests = "python -m unittest discover -v -s ./tests -p test_*.py"

[packages]
pyyaml = "*"
Loading