Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Cmiel <acmiel@redhat.com>
  • Loading branch information
chmeliik committed Nov 15, 2019
1 parent f8df76d commit 0575377
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 2 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/test-sh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Run tests using test.sh

on: [pull_request]

jobs:
pytest:
name: Python ${{ matrix.os.python }} tests on ${{ matrix.os.name }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os:
- name: centos
version: 7
python: 2

- name: fedora
version: 29
python: 2

- name: fedora
version: 30
python: 3

steps:
- uses: actions/checkout@v1

- run: ./test.sh
env:
OS: ${{ matrix.os.name }}
OS_VERSION: ${{ matrix.os.version }}
PYTHON_VERSION: ${{ matrix.os.python }}

- name: Post coverage results to Coveralls.io
uses: coverallsapp/github-action@v1.0.1
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: ./.coverage
parallel: true


coveralls:
name: Finish parallel job on Coveralls.io
runs-on: ubuntu-latest

needs: pytest

steps:
- uses: coverallsapp/github-action@v1.0.1
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true


bandit:
name: Bandit analyzer for python ${{ matrix.fedora.python }}
runs-on: ubuntu-latest

strategy:
matrix:
fedora:
- version: 29
python: 2

- version: 30
python: 3

steps:
- uses: actions/checkout@v1

- run: ./test.sh
env:
OS: fedora
OS_VERSION: ${{ matrix.fedora.version }}
PYTHON_VERSION: ${{ matrix.fedora.python }}
ACTION: bandit
4 changes: 2 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi


CONTAINER_NAME="dockerfile-parse-$OS-$OS_VERSION-py$PYTHON_VERSION"
RUN="docker exec -ti $CONTAINER_NAME"
RUN="docker exec -i $CONTAINER_NAME"
if [[ $OS == "fedora" ]]; then
PIP_PKG="python$PYTHON_VERSION-pip"
PIP="pip$PYTHON_VERSION"
Expand Down Expand Up @@ -75,7 +75,7 @@ if [[ $PYTHON_VERSION -gt 2 ]]; then $RUN $PIP install -r requirements-py3.txt;

case ${ACTION} in
"test")
TEST_CMD="py.test --cov dockerfile_parse --cov-report html -vv tests"
TEST_CMD="py.test --cov=dockerfile_parse --cov-report=html --color=yes -vv tests"
;;
"bandit")
$RUN $PKG install -y git-core
Expand Down

0 comments on commit 0575377

Please sign in to comment.