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

Github action for running test.sh #1

Closed
wants to merge 2 commits into from
Closed
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
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