Skip to content

Commit 7f83fc7

Browse files
authored
Merge pull request #1 from eecs485staff/madoop-develope
GitHub Actions CI
2 parents 9c4aaea + 39d48f5 commit 7f83fc7

File tree

4 files changed

+104
-6
lines changed

4 files changed

+104
-6
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# GitHub Continuous Integration Configuration
2+
name: CI
3+
4+
# Define conditions for when to run this action
5+
on:
6+
pull_request: # Run on all pull requests
7+
push: # Run on all pushes to master
8+
branches:
9+
- main
10+
- develop
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# A workflow run is made up of one or more jobs. Each job has an id, for
16+
# example, one of our jobs is "lint"
17+
jobs:
18+
test:
19+
name: Tests ${{ matrix.python-version }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
# Define OS and Python versions to use. 3.x is the latest minor version.
23+
matrix:
24+
python-version: ["3.6", "3.x"] # 3.x is the latest minor version
25+
os: [ubuntu-latest]
26+
27+
# Sequence of tasks for this job
28+
steps:
29+
# Check out latest code
30+
# Docs: https://github.com/actions/checkout
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
34+
# Set up Python
35+
# Docs: https://github.com/actions/setup-python
36+
- name: Set up Python ${{ matrix.python-version }}
37+
uses: actions/setup-python@v2
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
41+
# Install dependencies
42+
# https://github.com/ymyzk/tox-gh-actions#workflow-configuration
43+
- name: Install dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
pip install coverage tox tox-gh-actions
47+
48+
# Run tests
49+
# https://github.com/ymyzk/tox-gh-actions#workflow-configuration
50+
- name: Run tests
51+
run: tox
52+
# - name: Combine coverage
53+
# run: coverage xml
54+
55+
# Upload coverage report
56+
# https://github.com/codecov/codecov-action
57+
# - name: Upload coverage report
58+
# uses: codecov/codecov-action@v1
59+
# with:
60+
# fail_ci_if_error: true

MANIFEST.in

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
include LICENSE
2+
include MANIFEST.in
3+
include README.md
4+
include CONTRIBUTING.md
5+
include .pylintrc
6+
graft tests
7+
include test
8+
9+
# Avoid dev and and binary files
10+
exclude tox.ini
11+
exclude .editorconfig
12+
global-exclude *.pyc
13+
global-exclude __pycache__

tests/test_stages.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
System tests for the map stage of Michigan Hadoop.
3-
"""
1+
"""System tests for the map stage of Michigan Hadoop."""
42
import pathlib
53
import filecmp
64
import madoop
@@ -11,7 +9,7 @@
119

1210

1311
def test_map_stage(tmpdir):
14-
"""Test the map stage using word count example"""
12+
"""Test the map stage using word count example."""
1513
madoop.__main__.map_stage(
1614
exe=TESTDATA_DIR/"word_count/map.py",
1715
input_dir=TESTDATA_DIR/"word_count/correct/hadooptmp/mapper-input",
@@ -27,7 +25,7 @@ def test_map_stage(tmpdir):
2725

2826

2927
def test_group_stage(tmpdir):
30-
"""Test group stage using word count example"""
28+
"""Test group stage using word count example."""
3129
madoop.__main__.group_stage(
3230
input_dir=TESTDATA_DIR/"word_count/correct/hadooptmp/mapper-output",
3331
output_dir=tmpdir,
@@ -40,7 +38,7 @@ def test_group_stage(tmpdir):
4038

4139

4240
def test_reduce_stage(tmpdir):
43-
"""Test reduce stage using word count example"""
41+
"""Test reduce stage using word count example."""
4442
madoop.__main__.reduce_stage(
4543
exe=TESTDATA_DIR/"word_count/reduce.py",
4644
input_dir=TESTDATA_DIR/"word_count/correct/hadooptmp/grouper-output",

tox.ini

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Local host configuration with one Python 3 version
2+
[tox]
3+
envlist = py36, py37, py38, py39, py310
4+
5+
# GitHub Actions configuration with multiple Python versions
6+
# https://github.com/ymyzk/tox-gh-actions#tox-gh-actions-configuration
7+
[gh-actions]
8+
python =
9+
3.6: py36
10+
3.7: py37
11+
3.8: py38
12+
3.9: py39
13+
3.10: py310
14+
15+
# Run unit tests
16+
# HACK: Pydocstyle fails to find tests. Invoke a shell to use a glob.
17+
[testenv]
18+
setenv =
19+
PYTHONPATH = {toxinidir}
20+
allowlist_externals = sh
21+
extras = dev
22+
commands =
23+
pycodestyle madoop tests setup.py
24+
sh -c "pydocstyle madoop tests/* setup.py"
25+
pylint madoop tests setup.py
26+
check-manifest
27+
pytest -vvs

0 commit comments

Comments
 (0)