Skip to content
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
131 changes: 73 additions & 58 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,81 +9,56 @@ on:
- release_*

jobs:
# disable bandit because of the underlying docker image issue
# bandit:
# name: Bandit analyzer for Python ${{ matrix.os.python }} on
# ${{ matrix.os.name }}-${{ matrix.os.version }}
# runs-on: ubuntu-latest

# strategy:
# fail-fast: false
# matrix:
# os:
# - name: centos
# version: 7
# python: 3
# engine: docker

# - name: fedora
# version: 34
# python: 3
# engine: docker

# steps:
# - uses: actions/checkout@v1

# - run: ./test.sh
# env:
# OS: ${{ matrix.os.name }}
# OS_VERSION: ${{ matrix.os.version }}
# PYTHON_VERSION: ${{ matrix.os.python }}
# ENGINE: ${{ matrix.os.engine }}
# ACTION: bandit

flake8:
name: Flake8 for Python 3
name: Flake8 for Python ${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [ "3.8" ]

steps:
- name: Check out repo
uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox

- name: Run flake8 for Python 3
uses: containerbuildsystem/actions/flake8@master
- name: Run flake8 on python${{ matrix.python-version }}
run: python -m tox -e flake8

# markdownlint:
# name: Markdownlint
# runs-on: ubuntu-latest
markdownlint:
name: Markdownlint
runs-on: ubuntu-latest

# steps:
# - name: Check out repo
# uses: actions/checkout@v2
steps:
- name: Check out repo
uses: actions/checkout@v2

# - name: Run markdownlint
# uses: containerbuildsystem/actions/markdownlint@master
- name: Run markdownlint
uses: containerbuildsystem/actions/markdownlint@master

pylint:
name: Pylint analyzer for Python ${{ matrix.os.python }}
name: Pylint analyzer for Python ${{ matrix.python-version }}
runs-on: ubuntu-latest

strategy:
matrix:
os:
- name: fedora
version: 34
python: 3
engine: docker
python-version: [ "3.8" ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox

- run: ./test.sh
env:
OS: ${{ matrix.os.name }}
OS_VERSION: ${{ matrix.os.version }}
PYTHON_VERSION: ${{ matrix.os.python }}
ENGINE: ${{ matrix.os.engine }}
ACTION: pylint
- name: Run pylint on python${{ matrix.python-version }}
run: python -m tox -e pylint

shellcheck:
name: Shellcheck
Expand All @@ -95,3 +70,43 @@ jobs:

- name: Run ShellCheck
uses: containerbuildsystem/actions/shellcheck@master

# mypy:
# name: mypy type checker for Python ${{ matrix.python-version }}
# runs-on: ubuntu-latest
#
# strategy:
# matrix:
# python-version: [ "3.8" ]
#
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip setuptools tox
#
# - name: Run mypy on python${{ matrix.python-version }}
# run: python -m tox -e mypy

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

strategy:
matrix:
python-version: [ "3.8" ]

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox

- name: Run bandit analyzer on python${{ matrix.python-version }}
run: python -m tox -e bandit
57 changes: 20 additions & 37 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,68 +10,51 @@ on:

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

strategy:
fail-fast: false
matrix:
os:
- name: centos
version: 7
python: 3
engine: docker

- name: fedora
version: 33
python: 3
engine: docker

- name: fedora
version: 34
python: 3
engine: docker
python-version: ["3.6", "3.7", "3.8"]

steps:
- name: Check out repo
uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox

- name: pytests via test.sh
env:
OS: ${{ matrix.os.name }}
OS_VERSION: ${{ matrix.os.version }}
PYTHON_VERSION: ${{ matrix.os.python }}
ENGINE: ${{ matrix.os.engine }}
run: ./test.sh
- name: Run unittests on python${{ matrix.python-version }}
run: python -m tox -e test

- name: Upload pytest html report
uses: actions/upload-artifact@v2
if: failure()
with:
path: __pytest_reports/atomic-reactor-unit-tests.html
name: atomic-reactor-unit-tests_${{ matrix.os.name }}_${{ matrix.os.version }}.python${{ matrix.os.python }}.html
path: __pytest_reports/charon-unit-tests.html
name: charon-unit-tests_python${{ matrix.os.python }}.html


- name: Run coveralls-python
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.os.name }}-${{ matrix.os.version }}-python${{ matrix.os.python }}
COVERALLS_FLAG_NAME: python${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: |
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade coveralls
/home/runner/.local/bin/coveralls --service=github
python -m pip install --upgrade coveralls
python -m coveralls --service=github

coveralls-finish:
name: Finish coveralls-python
needs: test
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Finished
run: |
pip3 install --upgrade pip
pip3 install --upgrade setuptools
pip3 install --upgrade coveralls
pip3 install --upgrade pip setuptools coveralls
/home/runner/.local/bin/coveralls --finish --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion charon/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_config() -> Optional[CharonConfig]:

def get_template(template_file: str) -> str:
template = os.path.join(
os.getenv("HOME"), ".charon/template", template_file
os.getenv("HOME", ''), ".charon/template", template_file
)
if os.path.isfile(template):
with open(template, encoding="utf-8") as file_:
Expand Down
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

3 changes: 0 additions & 3 deletions test-coverage.sh

This file was deleted.

109 changes: 0 additions & 109 deletions test.sh

This file was deleted.

3 changes: 2 additions & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from tests.commons import TEST_BUCKET, TEST_MANIFEST_BUCKET
from moto import mock_s3

from tests.constants import HERE

SHORT_TEST_PREFIX = "ga"
LONG_TEST_PREFIX = "earlyaccess/all"
Expand Down Expand Up @@ -71,7 +72,7 @@ def change_home(self):
def __prepare_template(self, config_base):
template_path = os.path.join(config_base, 'template')
os.mkdir(config_base)
shutil.copytree(os.path.join(os.getcwd(), "template"), template_path)
shutil.copytree(os.path.join(HERE, "../template"), template_path)
if not os.path.isdir(template_path):
self.fail("Template initilization failed!")

Expand Down
Loading