Skip to content
check-square

GitHub Action

Python Unit Test

0.0.0 Pre-release

Python Unit Test

check-square

Python Unit Test

Test python packages

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Python Unit Test

uses: onichandame/[email protected]

Learn more about this action in onichandame/python-test-action

Choose a version

python-test-action

Github action that tests python package. Currently only works with unittest.

Author

onichandame

Pre-requisite

  1. This action assumes that a comprehensive dependency list exists in the project. The location of such list can be specified with parameters.

Usage

Basic

edit .github/workflows/python-test.yml

add content:

name: Test
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Prepare repo
        uses: actions/checkout@master
      - name: Test
        uses: onichandame/python-test-action@master

Advanced

If some customization is required, several parameters can be added.

name: Test
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Prepare repo
        uses: actions/checkout@master
      - name: Test
        uses: onichandame/python-test-action@master
        with:
          path: 'my-repo'
          deps_list: 'requirement'
  • path: the same path passed to actions/checkout
  • deps_list: the dependency list. default to requirements.txt