Skip to content

Run CI on GitHub Actions #413

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

Merged
merged 34 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5914303
Run CI on GitHub Actions
elacuesta Dec 2, 2021
a5a2482
Improve workflows
elacuesta Dec 2, 2021
9e30577
fail-fast=false
elacuesta Dec 2, 2021
c5218f4
Fix CI job descriptions
elacuesta Dec 2, 2021
0098028
Actually fix CI job descriptions
elacuesta Dec 2, 2021
6eb36fc
Update readme
elacuesta Dec 3, 2021
f479150
Add readme badges
elacuesta Dec 3, 2021
9b67916
Freze env on CI
elacuesta Dec 3, 2021
59ddb9f
xfail a deploy-egg test
elacuesta Dec 6, 2021
bccdf0f
Separate CI jobs
elacuesta Dec 6, 2021
d219026
Fix workflow file
elacuesta Dec 6, 2021
5c28a95
Mark test as flaky
elacuesta Dec 6, 2021
f9774e9
Generate coverage reports, fix CI job names
elacuesta Dec 6, 2021
6cf1c8e
Upload artifact
elacuesta Dec 15, 2021
6f9e281
Draft release
elacuesta Dec 15, 2021
7dc7cd8
Conditional publish job
elacuesta Dec 15, 2021
416c3bc
Fix binary path for upload
elacuesta Dec 15, 2021
cdc2bf1
Fix binary path for upload, again
elacuesta Dec 15, 2021
f6c76a6
Download binary artifacts before drafting release
elacuesta Dec 15, 2021
43aafef
Download binary artifacts before drafting release, fixed
elacuesta Dec 15, 2021
40e9e1e
Fix path for files included in release
elacuesta Dec 15, 2021
e456008
Fix file path
elacuesta Dec 15, 2021
86b6d86
Fix file path again
elacuesta Dec 15, 2021
d302e99
Fix file path once more
elacuesta Dec 15, 2021
342d6d2
Fix file path once more
elacuesta Dec 15, 2021
387d134
Rename binaries before uploading
elacuesta Dec 15, 2021
4d797c3
Rename binaries before uploading, again
elacuesta Dec 15, 2021
99cb4b9
Pack binaries before uploading
elacuesta Dec 15, 2021
76d993a
Fix file zipping in Windows
elacuesta Dec 15, 2021
db2ca14
Remove previous CI config files
elacuesta Dec 15, 2021
242a2f8
PyPI publishing job
elacuesta Dec 16, 2021
4b27852
Only publish tags
elacuesta Dec 16, 2021
32858ff
Only run CI on PRs and pushes to master
elacuesta Dec 16, 2021
1b668e4
Min Python version updates
elacuesta Dec 23, 2021
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
34 changes: 34 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Checks

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
checks:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: 3
env:
TOXENV: flake8

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Run check
env: ${{ matrix.env }}
run: |
pip install -U pip
pip install -U tox
tox
89 changes: 89 additions & 0 deletions .github/workflows/freeze-release-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Freeze, Release & Publish

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
freeze:
name: "Freeze: ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install tox
run: pip install tox

- name: Build binary
run: tox -e freeze

- name: Pack binary (Windows)
if: ${{ runner.os == 'Windows' }}
run: 7z a shub-Windows.zip dist_bin/shub.exe

- name: Pack binary (Linux/macOS)
if: ${{ runner.os != 'Windows' }}
run: tar -czvf shub-${{ runner.os }}.tar.gz dist_bin/shub

- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: shub-${{ runner.os }}
path: |
shub-${{ runner.os }}.tar.gz
shub-${{ runner.os }}.zip

release:
# if: startsWith(github.ref, 'refs/tags/v') # FIXME: uncomment before merging
needs: freeze
runs-on: ubuntu-latest

steps:
- name: Download binaries
uses: actions/download-artifact@v2
with:
path: binaries

- name: Display structure of downloaded files
run: ls -R binaries

- name: Draft release
uses: softprops/action-gh-release@v1
with:
draft: true
files: binaries/**

publish:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Publish to PyPI
run: |
pip install --upgrade pip
pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=${{ secrets.PYPI_TOKEN }}
twine upload dist/*
82 changes: 82 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
tests-ubuntu:
name: "Test: py${{ matrix.python-version }}, Ubuntu"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: pip install tox

- name: Run tests
run: tox -e py

- name: Upload coverage report
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov

tests-macos:
name: "Test: py${{ matrix.python-version }}, macOS"
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: pip install tox

- name: Run tests
run: tox -e py

tests-windows:
name: "Test: py${{ matrix.python-version }}, Windows"
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: pip install tox

- name: Run tests
run: tox -e py
109 changes: 0 additions & 109 deletions .travis.yml

This file was deleted.

17 changes: 16 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Scrapinghub command line client
===============================

.. image:: https://img.shields.io/pypi/v/shub.svg
:target: https://pypi.python.org/pypi/shub
:alt: PyPI Version

.. image:: https://github.com/scrapinghub/shub/actions/workflows/tests.yml/badge.svg
:target: https://github.com/scrapinghub/shub/actions/workflows/tests.yml
:alt: Tests

.. image:: https://img.shields.io/codecov/c/github/scrapinghub/shub/master.svg
:target: https://codecov.io/github/scrapinghub/shub?branch=master
:alt: Coverage report

``shub`` is the Scrapinghub command line client. It allows you to deploy
projects or dependencies, schedule spiders, and retrieve scraped data or logs
without leaving the command line.
Expand All @@ -9,7 +21,7 @@ without leaving the command line.
Requirements
------------

* Python 2.7+ or Python 3.5+
* Python >= 3.6


Installation
Expand All @@ -20,6 +32,9 @@ the Python Package Index::

pip install shub

Please note that if you are using Python < 3.6,
you should pin `shub` to `2.13.0` or lower.

We also supply stand-alone binaries. You can find them in our `latest GitHub
release`_.

Expand Down
12 changes: 5 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Release procedure for shub
==========================

The Travis build is configured to release shub to PyPI whenever a new tag is
committed.
The GitHub Actions build is configured to release `shub` to PyPI whenever
a new tag (starting with `v`, e.g. `v2.13.0`) is committed.

The steps to do a release are:

Expand All @@ -11,7 +11,7 @@ The steps to do a release are:
2. Make sure you're at the tip of master, and then run:

bumpversion VERSION_PART

In place of `VERSION_PART`, use one of `patch`, `minor` or `major`, meaning
the part of the version number to be updated.

Expand All @@ -28,7 +28,5 @@ The steps to do a release are:

https://github.com/scrapinghub/shub/releases

Travis and AppVeyor will automatically create a release draft and attach the
binaries they built to it. Sometimes their timing leads to them creating
multiple release drafts, in which case we need to combine them such that we
have one release that has all three (Linux, OSX, Windows) binaries.
The GitHub action will automatically create a release draft and attach the
platform-specific binaries (built with the `freeze` tox environment) to it.
Loading