Create main.yml #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python package # push package | |
on: [push] # When this action runs. | |
jobs: | |
build: | |
runs-on: ubuntu-latest # Which OS this runs on, you can also build on Windows or MacOS. | |
strategy: | |
matrix: | |
python-version: [3.6, 3.7, 3.8, 3.12] # You can build against multiple Python versions. | |
steps: | |
- uses: actions/checkout@v2 # Calling a pre-built GitHub Action which allows your Action to access your repository. | |
- name: Set up Python ${{ matrix.python-version }} # Name of an action that sets up Python. | |
uses: actions/setup-python@v2 # A pre-built GitHub Action that sets up a Python environment. | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies # The first step that isn't just calling another action. | |
run: | | |
python -m pip install --upgrade pip # Upgrade pip to the latest version. | |
pip install pytest # Install pytest. | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi # If we have a requirements.txt, then install it. | |
- name: Test with pytest # Final action which runs pytest. If any test fails, then this Action fails. | |
run: | | |
pytest | |