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

add github action for tests #623

Merged
merged 9 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from 8 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
19 changes: 0 additions & 19 deletions .appveyor.yml

This file was deleted.

1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: github-actions
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ So you want to write code and get it landed in the official mozdownload reposito
For writing the code just follow our [Python style guide](http://ateam-bootcamp.readthedocs.org/en/latest/reference/python-style.html), and also test with [pylama](https://pypi.python.org/pypi/pylama). If there is something unclear of the style, just look at existing code which might help you to understand it better.

### Submitting Patches
When you think the code is ready for review a pull request should be created on Github. Owners of the repository will watch out for new PR's and review them in regular intervals. By default for each change in the PR we automatically run all the tests via [Travis CI](http://travis-ci.org/). If tests are failing make sure to address the failures immediately. Otherwise you can wait for a review. If comments have been given in a review, they have to get integrated. For those changes a separate commit should be created and pushed to your remote development branch. Don't forget to add a comment in the PR afterward, so everyone gets notified by Github. Keep in mind that reviews can span multiple cycles until the owners are happy with the new code.
When you think the code is ready for review a pull request should be created on Github. Owners of the repository will watch out for new PR's and review them in regular intervals. By default for each change in the PR we automatically run all the tests via [Github Actions](https://github.com/mozilla/mozdownload/actions). If tests are failing make sure to address the failures immediately. Otherwise you can wait for a review. If comments have been given in a review, they have to get integrated. For those changes a separate commit should be created and pushed to your remote development branch. Don't forget to add a comment in the PR afterward, so everyone gets notified by Github. Keep in mind that reviews can span multiple cycles until the owners are happy with the new code.

## Managing the Repository

### Merging Pull Requests
Once a PR is in its final state it needs to be merged into the upstream master branch. For that please **DO NOT** use the Github merge button! But merge it yourself on the command line. Reason is that we want to hvae a clean history. Before pushing the changes to upstream master make sure that all individual commits have been squashed into a single one with a commit message ending with the issue number, e.g. "Fix for broken download behavior (#45)". Also check with `git log` to not push merge commits. Only merge PRs where Travis does not report any failure!
Once a PR is in its final state it needs to be merged into the upstream master branch. For that please **DO NOT** use the Github merge button! But merge it yourself on the command line. Reason is that we want to hvae a clean history. Before pushing the changes to upstream master make sure that all individual commits have been squashed into a single one with a commit message ending with the issue number, e.g. "Fix for broken download behavior (#45)". Also check with `git log` to not push merge commits. Only merge PRs where Github Actions does not report any failure!

### Versioning
In irregular intervals we are releasing new versions of mozdownload. Therefore we make use of milestones in the repository. For each implemented feature or fix the issue's milestone flag should be set to the next upcoming release. That way its easier to see what will be part of the next release.
Expand Down
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
allow:
- dependency-type: all
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Test

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

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# linux
- os: ubuntu-latest
python: 3.7
toxenv: py37
- os: ubuntu-latest
python: 3.8
salilmishra23 marked this conversation as resolved.
Show resolved Hide resolved
toxenv: py38
- os: ubuntu-latest
python: 3.9
toxenv: py39
# Blocked by https://github.com/web-platform-tests/wpt/issues/35978
# - os: ubuntu-latest
# python: "3.10"
# toxenv: py310
# windows
- os: windows-latest
python: 3.8
toxenv: py38
# macos
- os: macos-latest
python: 3.8
toxenv: py38
# misc
- os: ubuntu-latest
python: 3.8
toxenv: pylama

steps:
- uses: actions/checkout@v3

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

- name: Install dependencies
run: python -m pip install -U tox

- name: Tox tests
run: tox -e ${{ matrix.toxenv }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 0 additions & 4 deletions .pyup.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .travis/install.sh

This file was deleted.

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
is a [python package](http://pypi.python.org/pypi/mozdownload)
which handles downloading of Mozilla applications.

[![Travis](https://travis-ci.org/mozilla/mozdownload.svg?branch=master)](https://travis-ci.org/mozilla/mozdownload)
[![Coverage](https://coveralls.io/repos/github/mozilla/mozdownload/badge.svg)](https://coveralls.io/github/mozilla/mozdownload)
[![Issues](https://img.shields.io/github/issues/mozilla/mozdownload.svg)](https://github.com/mozilla/mozdownload/issues)
[![pyup.io](https://pyup.io/repos/github/mozilla/mozdownload/shield.svg)](https://pyup.io/repos/github/mozilla/mozdownload/)

## Installation

Expand Down
8 changes: 4 additions & 4 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
coveralls==1.8.1
pytest==4.6.3
pytest-cov==2.7.1
pytest-mock==1.10.4
coveralls[yaml]==3.3.1
pytest==7.1.3
pytest-cov==3.0.0
pytest-mock==3.8.2
wptserve==3.0
1 change: 1 addition & 0 deletions tests/remote/test_firefox.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def test_daily_scraper(tmpdir, args):
mozdownload.DailyScraper(destination=tmpdir, **args)


@pytest.mark.skip(reason="Fails with network timeout for some parameters")
whimboo marked this conversation as resolved.
Show resolved Hide resolved
@pytest.mark.ci_only
@pytest.mark.parametrize("args", [
{'branch': 'mozilla-central', 'platform': 'linux'},
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[tox]
envlist = py37, pylama
envlist = py37, py38, py39, pylama

[testenv]
usedevelop = true
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH CI
passenv = GITHUB_* CI
deps = -rrequirements/tests.txt
commands =
pytest --verbose --cov {posargs}
-coveralls
-coveralls --service=github

[testenv:pylama]
deps = pylama
Expand Down