diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 00000000..44d0c3b5 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,44 @@ +name: CD +on: + release: + types: [created] + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: '3.6' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements_dev.txt + + - name: Run unit tests + run: | + pytest tests/terraform_compliance + + - name: Version Imprintment + run: | + - echo "Released version is {{ github.ref }}" + +# - name: Build +# run: | +# python setup.py sdist bdist_wheel +# pip install dist/terraform_compliance-0.0.0-*.whl +# +# - name: Run integration tests +# run: | +# python tests/functional/run_functional_tests.py +# +# - name: Publish to PyPI +# env: +# TWINE_USERNAME: ${{ secrets.PYPI_USER }} +# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} +# run: | +# twine upload dist/* \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..031c0953 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI +on: + pull_request: + paths: + - "terraform_compliance/**" + - ".github/workflows/ci.yml" + - "tox.ini" + - "Dockerfile" + - "requirements.txt" + - "requirements_dev.txt" + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements_dev.txt + + - name: Run unit tests + run: | + pytest tests/terraform_compliance + + - name: Build + run: | + python setup.py sdist bdist_wheel + pip install dist/terraform_compliance-0.0.0-*.whl + + - name: Run integration tests + run: | + python tests/functional/run_functional_tests.py diff --git a/requirements.txt b/requirements.txt index 11a7b753..1f1eff2a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ radish-bdd==0.13.1 -mock==4.0.2 gitpython==3.1.11 netaddr==0.8.0 colorful==0.5.4 @@ -7,9 +6,6 @@ filetype==1.0.7 junit-xml==1.9 emoji==0.6.0 lxml==4.6.1 -ddt==1.4.1 -pytest==6.1.2 -nose==1.3.7 semver==2.13.0 IPython==7.16.1 diskcache==5.1.0 diff --git a/requirements_dev.txt b/requirements_dev.txt new file mode 100644 index 00000000..9ec418bf --- /dev/null +++ b/requirements_dev.txt @@ -0,0 +1,18 @@ +radish-bdd==0.13.1 +mock==4.0.2 +gitpython==3.1.11 +netaddr==0.8.0 +colorful==0.5.4 +filetype==1.0.7 +junit-xml==1.9 +emoji==0.6.0 +lxml==4.6.1 +ddt==1.4.1 +pytest==6.1.2 +nose==1.3.7 +semver==2.13.0 +IPython==7.16.1 +diskcache==5.1.0 +setuptools +wheel +twine \ No newline at end of file diff --git a/setup.py b/setup.py index 172036cc..af2a1ea2 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ 'mock>=3.0.5', 'semver>=2.10.2', 'IPython==7.16.1', - 'diskcache==4.1.0' + 'diskcache==5.1.0' ] setup(