Skip to content

Commit

Permalink
Switching from Travis CI to Github Actions (#407)
Browse files Browse the repository at this point in the history
* Added initial CI workflow

* Removed python 3.5 from the supported list

* Added build on the CI.

* Fixed a wording on packaging

* Added required packages for build

* Adding installation of terraform-compliance within the CI after build

* Changed .tgz to .whl

* Added initial CD action
  • Loading branch information
eerkunt authored Nov 9, 2020
1 parent 5fe1c2f commit 446980c
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 5 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -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/*
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
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
18 changes: 18 additions & 0 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 446980c

Please sign in to comment.