Skip to content

test: make a test configuration file which will work under GitHub branch protection rule.  #16

@ksauraj

Description

@ksauraj

We can utilise GitHub branch protection rule and make a github workflow file to run some tests before merging a pull request.

You can utilise tools like unittest to do so.

This might be a sample for .github/workflows/test.yml file

name: Run Tests

on:
  push:
    branches:
      - main  # Adjust the branch name as needed

jobs:
  test:
    runs-on: ubuntu-latest

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

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8  # Adjust the Python version as needed

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt  # If you have a requirements file

      - name: Run tests
        run: python -m unittest discover -v

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions