Skip to content

Add yet_another_function() #34

Add yet_another_function()

Add yet_another_function() #34

Workflow file for this run

name: Checks
on:
push:
branches:
- main
pull_request:
env:
PYTEST_ADDOPTS: "--color=yes"
defaults:
run:
# -l: login shell, needed when using Conda
shell: bash -l {0}
jobs:
show-info:
runs-on: ubuntu-latest
steps:
- name: Show event payload
uses: actions/github-script@v7
with:
script: |
txt = JSON.stringify(context.payload, null, 4);
core.summary.addCodeBlock(txt, 'json');
core.summary.write()
pytest:
name: pytest (${{ matrix.os }}/py${{ matrix.python-version }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
os: [linux, win64]
python-version: ['3.10', '3.11', '3.12']
include:
- os: linux
runner: ubuntu-latest
- os: win64
runner: windows-latest
- python-version: '3.11'
coverage: 'true'
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: pip install
run: |
pip install --progress-bar off --editable .
- name: Add coverage options
if: matrix.coverage
run: |
echo PYTEST_ADDOPTS="$PYTEST_ADDOPTS --cov --cov-report=xml" >> "$GITHUB_ENV"
- run: |
pytest --pyargs sample
- name: Upload coverage report
if: matrix.coverage
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.os }}
path: coverage.xml
if-no-files-found: error
- name: Upload event payload
uses: actions/upload-artifact@v4
# ensure this is uploaded only once
if: matrix.coverage && matrix.os == 'linux'
with:
path: ${{ github.event_path }}
name: event-payload
if-no-files-found: error