I have a short workflow that starts out like this:
---
name: MYTESTS-APPROVED
on: [push,pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5,3.6,3.7] # this can be changed by the user
os: [macOS-latest, ubuntu-latest] # this can be changed by the user
steps:
- name: STEP 1. Check-Out Repo
uses: actions/checkout@v2
#===============================================#
- name: STEP 2. Set-Up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
#===============================================#
- name: STEP 3. Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install --no-binary :all: nmslib
pip install .
pip install python-coveralls
- name: STEP 4. Pytest Coverage
run: |
pip install coveralls
pip install junit2html
python setup.py test \
--addopts "--mpl-generate-path=tests/baseline_images \
--color=yes --cov-config .coveragerc --cov-branch \
--cov=scedar --junitxml=junitxml-doc.xml"
junit2html junitxml-doc.xml coverage-report.html
My group is working on a project where we will have people add this .yml file to their github repos where it will be used to run their tests. If the tests pass then they will get our custom badge as a stamp of approval. I would like the .yml file to be as easy and straightfoward to use, so it would be great if I could wrap this workflow up in a single action and just include the parts they need to configure themselves as inputs for this action. This way the .yaml file they see will be very simple and straightfoward.
I was thinking about making a python based action because I’m using strictly python modules anyway. Can this be done easily? Any help is much appreciated!