Skip to content

Commit

Permalink
Merge pull request #59 from cytopia/release-0.0.10
Browse files Browse the repository at this point in the history
Release 0.0.10
  • Loading branch information
cytopia authored May 1, 2020
2 parents 4647979 + 9b8f73c commit 6e9ca6a
Show file tree
Hide file tree
Showing 29 changed files with 6,624 additions and 7,453 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/code-black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

###
### Code style
###

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

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
target:
- black
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: "${{ matrix.target }}"
run: |
make ${{ matrix.target }}
30 changes: 30 additions & 0 deletions .github/workflows/code-mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

###
### Code style
###

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

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
target:
- mypy
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: "${{ matrix.target }}"
run: |
make ${{ matrix.target }}
30 changes: 30 additions & 0 deletions .github/workflows/code-pycodestyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

###
### Code style
###

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

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
target:
- pycodestyle
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: "${{ matrix.target }}"
run: |
make ${{ matrix.target }}
30 changes: 30 additions & 0 deletions .github/workflows/code-pydocstyle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

###
### Code style
###

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

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
target:
- pydocstyle
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: "${{ matrix.target }}"
run: |
make ${{ matrix.target }}
30 changes: 30 additions & 0 deletions .github/workflows/code-pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---

###
### Code style
###

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

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
target:
- pylint
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: "${{ matrix.target }}"
run: |
make ${{ matrix.target }}
46 changes: 46 additions & 0 deletions .github/workflows/gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

set -e
set -u
set -o pipefail

SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"

TPL_NAME="template-test.tpl"
TPL_PATH="${SCRIPT_PATH}/${TPL_NAME}"
FLW_PATH="${SCRIPT_PATH}"


###
### Build Matrix
###
PYTHON_VERSIONS=("2.7" "3.6" "3.7" "3.8")
OPERATING_SYSTEMS=("ubuntu" "windows" "macos")


for os in ${!OPERATING_SYSTEMS[*]}; do
for v in ${!PYTHON_VERSIONS[*]}; do
out_file="${FLW_PATH}/test-${OPERATING_SYSTEMS[${os}]//ubuntu/linux}-${PYTHON_VERSIONS[${v}]}.yml"
flw_name="${OPERATING_SYSTEMS[${os}]:0:3}-${PYTHON_VERSIONS[${v}]}"
job_name="[${OPERATING_SYSTEMS[${os}]:0:3}] ${PYTHON_VERSIONS[${v}]}"
os_name="${OPERATING_SYSTEMS[${os}]}-latest"
python="${PYTHON_VERSIONS[${v}]}"

flw_name="${flw_name//ubu/lin}"
job_name="${job_name//ubu/lin}"

printf "%s\\n" "-----------------------------------------------------------"
printf "file: %s\\n" "${out_file}"
printf "flw name: %s\\n" "${flw_name}"
printf "job name: %s\\n" "${job_name}"
printf "OS: %s\\n" "${os_name}"
printf "Python: %s\\n" "${python}"

cat "${TPL_PATH}" \
| sed "s/__WORKFLOW_NAME__/${flw_name}/g" \
| sed "s/__OS__/${os_name}/g" \
| sed "s/__PYTHON_VERSION__/${python}/g" \
| sed "s/__JOB_NAME__/${job_name}/g" \
> "${out_file}"
done
done
12 changes: 0 additions & 12 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,6 @@ jobs:
run: |
make lint-files
- name: Python Black
run: |
make black
- name: PyCodeStyle
run: |
make pycodestyle
- name: PyDocStyle
run: |
make pydocstyle
- name: Check consistent version
run: |
make version
Expand Down
153 changes: 153 additions & 0 deletions .github/workflows/template-test.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---

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

jobs:
test:
runs-on: __OS__
strategy:
fail-fast: False
matrix:
version:
- __PYTHON_VERSION__

name: "__JOB_NAME__"
steps:
# ------------------------------------------------------------
# Setup
# ------------------------------------------------------------
- name: Checkout repository
uses: actions/checkout@v2

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

# ------------------------------------------------------------
# Tests: Behaviour
# ------------------------------------------------------------

###
### Shutdown
###
- name: "[BEHAVIOUR] (TCP) Client shutdown"
shell: bash
run: |
make test-behaviour-tcp_client_exits_and_server_hangs_up

- name: "[BEHAVIOUR] (UDP) Client shutdown"
shell: bash
run: |
make test-behaviour-udp_client_exits_and_server_stays_alive

- name: "[BEHAVIOUR] (TCP) Server shutdown"
shell: bash
run: |
make test-behaviour-tcp_server_exits_and_hangs_up

- name: "[BEHAVIOUR] (UDP) Server shutdown"
shell: bash
run: |
make test-behaviour-udp_server_exits_and_client_stays_alive

###
### Socket
###
- name: "[BEHAVIOUR] (TCP) Socket REUSEADDR"
shell: bash
run: |
make test-behaviour-tcp_socket_reuseaddr

- name: "[BEHAVIOUR] (UDP) Socket REUSEADDR"
shell: bash
run: |
make test-behaviour-udp_socket_reuseaddr

# ------------------------------------------------------------
# Tests: Basic
# ------------------------------------------------------------

###
### Client requests
###
- name: "[BASICS] (TCP) Client makes HTTP request"
shell: bash
run: |
make test-basics-client-tcp_make_http_request

###
### Client sends data/file/command to server
###
- name: "[BASICS] (TCP) Client sends data to Server"
shell: bash
run: |
make test-basics-client-tcp_send_text_to_server

- name: "[BASICS] (UDP) Client sends data to Server"
shell: bash
run: |
make test-basics-client-udp_send_text_to_server

- name: "[BASICS] (TCP) Client sends file to Server"
shell: bash
run: |
make test-basics-client-tcp_send_file_to_server

- name: "[BASICS] (UDP) Client sends file to Server"
shell: bash
run: |
make test-basics-client-udp_send_file_to_server

- name: "[BASICS] (TCP) Client sends command to Server"
shell: bash
run: |
make test-basics-client-tcp_send_comand_to_server

- name: "[BASICS] (UDP) Client sends command to Server"
shell: bash
run: |
make test-basics-client-udp_send_comand_to_server

# ------------------------------------------------------------
# Tests: Options
# ------------------------------------------------------------

###
### DNS Resolution
###
- name: "[OPTIONS] (TCP) Client --nodns"
shell: bash
run: |
make test-options-client-tcp_nodns

- name: "[OPTIONS] (UDP) Client --nodns"
shell: bash
run: |
make test-options-client-udp_nodns

###
### Keep open
###
- name: "[OPTIONS] (TCP) Server --keep-open"
shell: bash
run: |
make test-options-tcp_server_keep_open

# ------------------------------------------------------------
# Tests: Modes
# ------------------------------------------------------------

###
### Port Forward
###
- name: "[MODES] (TCP) Port Forward"
shell: bash
run: |
make test-modes-forwawrd_tcp-client_make_http_request
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

name: Linux
name: lin-2.7
on:
pull_request:
push:
Expand All @@ -16,11 +16,8 @@ jobs:
matrix:
version:
- 2.7
- 3.6
- 3.7
- 3.8

name: "[${{ matrix.version}}]"
name: "[lin] 2.7"
steps:
# ------------------------------------------------------------
# Setup
Expand Down
Loading

0 comments on commit 6e9ca6a

Please sign in to comment.