Testing with Github Actions
- Github Actions
- https://docs.github.com/en/actions/about-github-actions/understanding-github-actions
- Actions: An action is a custom application for the GitHub Actions platform that performs a complex but frequently repeated task.
- Runner: A runner is a server that runs your workflows when they're triggered. Each runner can run a single job at a time.
-
Set yaml
- https://github.com/PARKCHEOLHEE-lab/debugvisualizer/blob/main/.github/workflows/ci.yaml
-
name: workflow name -
on: trigger -
actions/checkout@v2: clone and checkout repository ... -
actions/setup-python@v2: Install Python -
name: Install dependencies: Install dependencies using pip -
name: Run tests: Execute pytest
name: Python CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2 # https://github.com/marketplace/actions/setup-python
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
env:
PYTHONPATH: ${{ github.workspace }}
run: |
pytest tests/
- when tests are passed:
- https://github.com/PARKCHEOLHEE-lab/debugvisualizer/actions/runs/9722049008/job/26835476847#step:5:1
============================= test session starts ==============================
platform linux -- Python 3.10.14, pytest-8.2.2, pluggy-1.5.0
rootdir: /home/runner/work/debugvisualizer/debugvisualizer
configfile: pyproject.toml
collected 2 items
tests/test_plotter.py .. [100%]
============================== 2 passed in 0.20s ===============================