Skip to content

Use individual artifacts per job #62

Use individual artifacts per job

Use individual artifacts per job #62

Workflow file for this run

name: Python package scrapy_rss testing
on:
pull_request:
push:
branches:
- develop
- master
paths-ignore:
- 'scrapy_rss/VERSION'
jobs:
main-pythons-tests:
strategy:
fail-fast: false
matrix:
env:
- platform: 'ubuntu-20.04'
python-version: 2.7
- platform: 'ubuntu-20.04'
python-version: 3.6
- platform: 'ubuntu-22.04'
python-version: 3.7
- platform: 'ubuntu-22.04'
python-version: 3.8
- platform: 'ubuntu-latest'
python-version: 3.9
- platform: 'ubuntu-latest'
python-version: '3.10'
- platform: 'ubuntu-latest'
python-version: '3.11'
- platform: 'ubuntu-latest'
python-version: '3.12'
- platform: 'ubuntu-latest'
python-version: '3.13'
runs-on: ${{ matrix.env.platform }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.env.python-version }} from the repository
if: ${{ matrix.env.python-version == '2.7' }}
run: |
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
python get-pip.py
- name: Set up Python ${{ matrix.env.python-version }} using actions
if: ${{ matrix.env.python-version != '2.7' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.env.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ strategy.job-index }}
path: .cov/.coverage*
retention-days: 1
include-hidden-files: true
coverage:
runs-on: ubuntu-latest
name: Coverage combining and reporting
needs: main-pythons-tests
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: coverage-*
path: .cov
merge-multiple: true
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'coverage<5' codecov
- name: Combine .coverage
run: |
python -m coverage combine .cov/.coverage*
python -m coverage xml
python -m coverage report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: true