Skip to content

Commit

Permalink
Merge pull request #4 from CSC-510-G55/static-workflows
Browse files Browse the repository at this point in the history
feat: workflows + badges for pylint & radon
  • Loading branch information
siriscmv authored Sep 10, 2024
2 parents 016ebda + 0173b03 commit deb08e9
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 10 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Pylint
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
pylint:
name: Pylint
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Environment
run: |
chmod +x ./.github/workflows/setup.sh && ./.github/workflows/setup.sh
pip install pylint
- name: Run Pylint
run: |
output=$(pylint hw2_debugging.py rand.py --output-format=parseable)
echo "$output" > pylint.txt
echo "::notice title=Pylint::$output"
- name: Pylint report
uses: actions/upload-artifact@v4
with:
name: pylint-report
path: pylint.txt
34 changes: 34 additions & 0 deletions .github/workflows/radon.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Radon
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
radon:
name: Radon
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Environment
run: |
chmod +x ./.github/workflows/setup.sh && ./.github/workflows/setup.sh
pip install radon
- name: Run Radon
run: |
output=$(radon cc hw2_debugging.py rand.py -s)
echo "$output" > radon.txt
echo "::notice title=Radon::$output"
- name: Radon report
uses: actions/upload-artifact@v4
with:
name: radon-report
path: radon.txt
11 changes: 11 additions & 0 deletions .github/workflows/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

sudo apt update -y
sudo apt upgrade -y
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update -y
sudo apt install python3.13 -y

alias python=python3.13
alias pip='python3.13 -m pip'
11 changes: 1 addition & 10 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,7 @@ jobs:

- name: Set up Environment
run: |
sudo apt update -y
sudo apt upgrade -y
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update -y
sudo apt install python3.13 -y
alias python=python3.13
alias pip='python3.13 -m pip'
chmod +x ./.github/workflows/setup.sh && ./.github/workflows/setup.sh
pip install pytest pytest-cov
- name: Test with pytest
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
![Language](https://img.shields.io/badge/language-python%20v3.13-green)
![License](https://img.shields.io/badge/license-MIT-green)
![Platform](https://img.shields.io/badge/platform-linux-green)
[![Pylint](https://github.com/CSC-510-G55/hw2/actions/workflows/pylint.yml/badge.svg)](https://github.com/CSC-510-G55/hw2/actions/workflows/pylint.yml)
[![Radon](https://github.com/CSC-510-G55/hw2/actions/workflows/radon.yml/badge.svg)](https://github.com/CSC-510-G55/hw2/actions/workflows/radon.yml)

0 comments on commit deb08e9

Please sign in to comment.