Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate CI from Travis to GitHub Actions #172

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
pull_request:
Comment on lines +3 to +5
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflows added from a fork don't run by default (for security reasons) but you can check the results on my fork: https://github.com/browniebroke/snapshottest/actions

You probably want to disable CI on pushes to non-master branch before merging:

Suggested change
on:
push:
pull_request:
on:
push:
branches:
- master
pull_request:


concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
make-target:
- lint
- format
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- run: make install-tools
- run: make ${{ matrix.make-target }}

tests:
name: Python ${{ matrix.versions.python }}
runs-on: ${{ matrix.versions.os }}
strategy:
fail-fast: false
matrix:
versions:
- python: "3.6"
os: ubuntu-20.04
- python: "3.7"
os: ubuntu-22.04
- python: "3.8"
os: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.versions.python }}
- run: make install
- run: make test
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ install:

.PHONY: install-tools
install-tools:
pip install flake8 black==20.8b1
pip install flake8 black==20.8b1 'click<8'

.PHONY: test
test:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SnapshotTest [![travis][travis-image]][travis-url] [![pypi][pypi-image]][pypi-url]
# SnapshotTest [![ci][ci-image]][ci-url] [![pypi][pypi-image]][pypi-url]

[travis-image]: https://img.shields.io/travis/syrusakbary/snapshottest.svg?style=flat
[travis-url]: https://travis-ci.org/syrusakbary/snapshottest
[ci-image]: https://github.com/syrusakbary/snapshottest/actions/workflows/ci.yml/badge.svg?branch=master
[ci-url]: https://github.com/syrusakbary/snapshottest/actions/workflows/ci.yml
[pypi-image]: https://img.shields.io/pypi/v/snapshottest.svg?style=flat
[pypi-url]: https://pypi.python.org/pypi/snapshottest

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
with open("README.md") as f:
readme = f.read()

tests_require = ["pytest>=4.6", "pytest-cov", "nose", "django>=1.10.6"]
tests_require = ["pytest>=4.6", "pytest-cov", "nose", "django>=1.10.6,<4"]

setup(
name="snapshottest",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_basic_formatting_parsing(value):
formatted = formatter(value)
parsed = eval(formatted)
assert parsed == value
assert type(parsed) == type(value)
assert type(parsed) is type(value)


def test_formatting_parsing_nan():
Expand Down