Skip to content

Migrate CI from Travis to GitHub Actions with Python 2.7 and 3.11 #7

Migrate CI from Travis to GitHub Actions with Python 2.7 and 3.11

Migrate CI from Travis to GitHub Actions with Python 2.7 and 3.11 #7

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test-python27:
runs-on: ubuntu-latest
container: python:2.7-slim
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
pip install .
pip install coveralls
- name: Run tests with coverage
run: |
coverage run setup.py test
- name: Upload coverage to Coveralls
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: python-2.7
COVERALLS_PARALLEL: true
run: |
coveralls --service=github
- name: Generate coverage report
if: success()
run: |
coverage report
test-python311:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install .
pip install coveralls
- name: Run tests with coverage
run: |
coverage run setup.py test
- name: Upload coverage to Coveralls
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: python-3.11
COVERALLS_PARALLEL: true
run: |
coveralls --service=github
- name: Generate coverage report
if: success()
run: |
coverage report
coveralls-finish:
needs: [test-python27, test-python311]
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true