Skip to content

Commit bc210c0

Browse files
committed
Migrate CI from Travis to GitHub Actions
Replace the Travis config with a tests workflow on GitHub Actions: style job (black + flake8 + pep8-naming) and a Python 3.10-3.14 test matrix, with coverage uploaded via codecov-action. README badges updated to point at the new workflow and the main branch. Third-party actions are pinned by full commit SHA (with a `# vN.M.P` comment noting the tag at pin time) for supply-chain hardening: - actions/checkout v6.0.2 - actions/setup-python v6.2.0 - codecov/codecov-action v6.0.1 The checkout step uses fetch-depth: 0 so the tests can run git blame against historical SHAs in the repo's own history. Also drops an unused `import glob` in contrib/main.py so flake8 passes. Assisted-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 0ff48ad commit bc210c0

4 files changed

Lines changed: 62 additions & 51 deletions

File tree

.github/workflows/tests.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
# Third-party actions are pinned by full commit SHA (with a `# vN.M.P`
10+
# comment noting the tag at pin time) so that supply-chain attacks on the
11+
# action repos can't silently introduce new behavior. Dependabot/renovate
12+
# can bump these the same way it bumps any other dependency.
13+
14+
jobs:
15+
style:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
20+
with:
21+
python-version: '3.12'
22+
- name: Install style tools
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install black flake8 pep8-naming
26+
- name: black
27+
run: black --diff --check .
28+
- name: flake8
29+
run: flake8
30+
31+
test:
32+
runs-on: ubuntu-latest
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
37+
steps:
38+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39+
with:
40+
# Tests run `git blame` against historical SHAs in the repo's own
41+
# history; the default shallow clone (fetch-depth: 1) breaks them.
42+
fetch-depth: 0
43+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
- name: Install
47+
run: |
48+
python -m pip install --upgrade pip
49+
pip install -r requirements.txt coverage
50+
pip install -e .
51+
- name: Run tests
52+
run: PYTHONPATH=. coverage run $(which pytest)
53+
- name: Upload coverage to Codecov
54+
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
55+
with:
56+
flags: py${{ matrix.python-version }}
57+
token: ${{ secrets.CODECOV_TOKEN }}
58+
env:
59+
OS: ${{ runner.os }}
60+
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

contrib/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import bisect
1010
import collections
1111
import contextlib
12-
import glob
1312
import json
1413
import sys
1514
import re

0 commit comments

Comments
 (0)