Skip to content

Commit e42d13a

Browse files
committed
Migrate CI from Travis to GitHub Actions
Replace the Travis config with a tests workflow on GitHub Actions: style job (black) and a Python 3.10-3.14 test matrix, with coverage uploaded via codecov-action@v4. README badges updated to point at the new workflow and the main branch. flake8 is omitted from the style job for now -- contrib/main.py has a pre-existing F401 (unused glob import) that will be cleaned up in the upcoming engine rework. The checkout step uses fetch-depth: 0 so the tests can run git blame against historical SHAs in the repo's own history. Assisted-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 0ff48ad commit e42d13a

3 files changed

Lines changed: 55 additions & 50 deletions

File tree

.github/workflows/tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
style:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.12'
17+
- name: Install style tools
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install black
21+
- name: black
22+
run: black --diff --check .
23+
24+
test:
25+
runs-on: ubuntu-latest
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
# Tests run `git blame` against historical SHAs in the repo's own
34+
# history; the default shallow clone (fetch-depth: 1) breaks them.
35+
fetch-depth: 0
36+
- uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Install
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install -r requirements.txt coverage
43+
pip install -e .
44+
- name: Run tests
45+
run: PYTHONPATH=. coverage run $(which pytest)
46+
- name: Upload coverage to Codecov
47+
uses: codecov/codecov-action@v4
48+
with:
49+
flags: py${{ matrix.python-version }}
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
env:
52+
OS: ${{ runner.os }}
53+
PYTHON: ${{ matrix.python-version }}

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Contrib
22

33
[![PyPI version](https://badge.fury.io/py/contrib.svg)](https://badge.fury.io/py/contrib)
4-
[![Build Status](https://travis-ci.com/spack/contrib.svg?branch=master)](https://travis-ci.com/spack/contrib)
5-
[![codecov](https://codecov.io/gh/spack/contrib/branch/master/graph/badge.svg)](https://codecov.io/gh/spack/contrib)
4+
[![tests](https://github.com/spack/contrib/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/spack/contrib/actions/workflows/tests.yml)
5+
[![codecov](https://codecov.io/gh/spack/contrib/branch/main/graph/badge.svg)](https://codecov.io/gh/spack/contrib)
66
[![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
77

88
A python package for making stacked area plots of contributions to a git

0 commit comments

Comments
 (0)