Skip to content
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
53 changes: 52 additions & 1 deletion .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,58 @@
name: GitHub Actions AWS connection
run-name: ${{ github.actor }} triggered the Github actions
on: [push]

on:
pull_request:
branches:
- main # Trigger on PR to the 'main' branch (adjust to your target branch)
push:
branches:
- main # Runs on push to main branch only (for Explore-GitHub-Actions)

jobs:
lint:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' # Ensure linting only runs for PR events
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Set up Python (for linting tools like flake8, black, yamllint)
uses: actions/setup-python@v2
with:
python-version: '3.x' # Adjust based on your Python version

- name: Install linting dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 black yamllint # Install your linting tools

- name: Run Linting (Python files, YAML files)
run: |
./test/lint.sh # Run your custom lint script from the test folder

unit-test:
runs-on: ubuntu-latest
needs: lint # Ensures linting passes before running tests
if: github.event_name == 'pull_request' # Ensure unit tests only run for PR events
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Set up Python (for unit testing)
uses: actions/setup-python@v2
with:
python-version: '3.x' # Adjust as needed

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # Adjust based on your setup

- name: Run unit tests
run: |
pytest test/ # Run your tests from the 'test' folder

Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -42,3 +92,4 @@ jobs:
sam deploy --config-file samconfig.toml --config-env default --resolve-s3 --no-confirm-changeset --no-fail-on-empty-changeset

- run: echo "This job's status is ${{ job.status }}."

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# API

## How to run the API for testing
## How to Run the API for Testing

### Installing AWS and SAM
- Install the AWS CLI and configure your credentials. (We did this in class, but if needed, the process is detailed [here](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/prerequisites.html)).
Expand Down
37 changes: 37 additions & 0 deletions tests/.pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[MASTER]
# Set the Python version
py-version=3.13

[MESSAGES CONTROL]
disable=
missing-docstring,
invalid-name,
too-few-public-methods,
too-many-arguments,
too-many-locals,
too-many-branches,
too-many-statements,
too-many-instance-attributes,
duplicate-code

[BASIC]
good-names=i,j,k,x,y,z,_

[FORMAT]
# Set max line length to a loose standard
max-line-length=150

[DESIGN]
# Allow higher complexity before warnings
max-attributes=10
max-args=10
max-locals=20
max-returns=10
max-branches=15
max-statements=50

[TYPECHECK]
disable=
no-member,
no-self-use

Loading