Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bmm21002 committed Feb 21, 2025
1 parent d3293ea commit 2f1dd41
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Python package

# This is a trigger for any push to the repo
on: [push]

# This trigger would only happen on a push to the lab3 branch
# on:
# push:
# branches:
# # Set this to "main" or "master" or whatever your main branch is called
# - lab3

jobs:
# Each job runs in parallel
name_your_job_whatever_you_want:

# runs-on indicates which GitHub "Runners" will run this CICD pipeline
# For all CSE-2102 repos, just use the following line as is
runs-on: self-hosted
# This next block allows you to run this ENTIRE job on different python versions
strategy:
matrix:
#python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8"]

# Steps are run in sequence in this job. If one step fails, the entire job fails.
steps:
# Use this next line to pull your repo into the Docker container running the job
- uses: actions/checkout@v3
# This block sets up the python version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Pylint is a static code analysis tool. Use this block as is to install pylint
# in the Docker container running the job
- name: Install pylint
run: |
python -m pip install --upgrade pip
pip install pylint
# Run pylint on your pulled code in the Docker container running the job
- name: Analysing the code with pylint
run: |
pylint --disable=C0114,C0116,C0325,C0305 $(git ls-files 'Lab03/*.py')
# Pytest is for unit testing your python code. Use this block as is to
# install pytest in the Docker container running the job
- name: Install pytest
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# Run pytest on your pulled codebase
- name: Test with pytest
run: |
pytest

0 comments on commit 2f1dd41

Please sign in to comment.