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

[misc] Migrate CI to GitHub Actions #17

Merged
merged 6 commits into from
May 11, 2021
Merged
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
54 changes: 54 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
create:
tags:
- "/^v\\d+\\.\\d+\\.\\d+(-(alpha|beta|rc)(\\.\\d+)?)?$/"
schedule:
- cron: "0 0 * * *"

jobs:
unit-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
exclude:
- os: macos-latest
python-version: 3.7
- os: macos-latest
python-version: 3.8
- os: macos-latest
python-version: 3.9
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install project
run: |
python -m pip install --upgrade pip
pip install -e .[TEST]
- name: Run static analysis
run: |
black --check .
flake8 --ignore=W503,E203
- name: Test with pytest
run: |
coverage run --branch \
--source repobee_feedback \
-m pytest tests
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
file: ./coverage.xml
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .travis/run.sh

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# repobee-feedback
[![Build Status](https://travis-ci.com/repobee/repobee-feedback.svg)](https://travis-ci.com/repobee/repobee-feedback)
[![Build Status](https://github.com/repobee/repobee-feedback/actions/workflows/tests.yml/badge.svg)](https://github.com/repobee/repobee-feedback/actions/workflows/tests.yml)
[![Code Coverage](https://codecov.io/gh/repobee/repobee-feedback/branch/master/graph/badge.svg)](https://codecov.io/gh/repobee/repobee-feedback)
[![PyPi Version](https://badge.fury.io/py/repobee-feedback.svg)](https://badge.fury.io/py/repobee-feedback)
![Supported Python Versions](https://img.shields.io/badge/python-3.6%7C3.7%7C3.8-blue)
Expand Down
8 changes: 4 additions & 4 deletions repobee_feedback/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import argparse
from typing import Iterable, Tuple, List

import daiquiri
import repobee_plug as plug

PLUGIN_NAME = "feedback"
Expand Down Expand Up @@ -66,10 +65,10 @@ class Feedback(plug.Plugin, plug.cli.Command):
)

allow_missing = plug.cli.flag(
help="emit a warning (instead of crashing) on missing issues",
help="emit a warning (instead of crashing) on missing issues"
)
batch_mode = plug.cli.flag(
short_name="-b", help="run without any yes/no prompts",
short_name="-b", help="run without any yes/no prompts"
)
truncation_length = plug.cli.option(
short_name="--tl",
Expand Down Expand Up @@ -97,7 +96,8 @@ class Feedback(plug.Plugin, plug.cli.Command):
help=(
"file containing issues to be opened, where each separate "
"issue starts with the line "
"#ISSUE#<STUDENT_REPO_NAME>#<ISSUE_TITLE>, followed by its body"
"#ISSUE#<STUDENT_REPO_NAME>#<ISSUE_TITLE>, followed by its "
"body"
),
converter=pathlib.Path,
),
Expand Down
2 changes: 2 additions & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ pytest
pytest-cov
repobee
codecov
black
flake8
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
__version__ = line.split("=")[1].strip(" '\"\n")
assert re.match(r"^\d+(\.\d+){2}(-(alpha|beta|rc)(\.\d+)?)?$", __version__)

test_requirements = ["pytest", "pytest-cov", "repobee", "codecov"]
test_requirements = [
"pytest",
"pytest-cov",
"repobee",
"codecov",
"black",
"flake8",
]
required = ["repobee>=3.0.0-beta.1"]

setup(
Expand Down
8 changes: 2 additions & 6 deletions tests/test_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ def with_issues(tmp_path):
"""Create issue files in a temporary directory and return a list of (team,
issue) tuples.
"""
repo_names = plug.generate_repo_names(
STUDENT_TEAM_NAMES, ASSIGNMENT_NAMES
)
repo_names = plug.generate_repo_names(STUDENT_TEAM_NAMES, ASSIGNMENT_NAMES)
existing_issues = []
for repo_name in repo_names:
issue_file = tmp_path / "{}.md".format(repo_name)
Expand All @@ -104,9 +102,7 @@ def with_issues(tmp_path):
@pytest.fixture
def with_multi_issues_file(tmp_path):
"""Create the multi issues file."""
repo_names = plug.generate_repo_names(
STUDENT_TEAM_NAMES, ASSIGNMENT_NAMES
)
repo_names = plug.generate_repo_names(STUDENT_TEAM_NAMES, ASSIGNMENT_NAMES)
repos_and_issues = [
(repo_name, random.choice(ISSUES)) for repo_name in repo_names
]
Expand Down