Skip to content

Commit 230c350

Browse files
authored
adding github-actions workflows (#54)
* adding github-actions unittest workflow * pin Pipfile to py36 * fix new-line endings * add mode to copy tasks * update tox file to remove the openshift and jmespath install
1 parent 6a6af58 commit 230c350

File tree

7 files changed

+835
-654
lines changed

7 files changed

+835
-654
lines changed

.github/workflows/unittests.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-18.04
13+
strategy:
14+
max-parallel: 4
15+
matrix:
16+
python-version: [3.6]
17+
18+
steps:
19+
- name: Checkout repsository
20+
uses: actions/checkout@v2
21+
22+
- name: Display build environment
23+
run: printenv
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install pipenv
31+
run: sudo python3 -m pip install pipenv
32+
33+
- name: Cache dependencies
34+
id: cache-dependencies
35+
uses: actions/cache@v2
36+
with:
37+
path: |
38+
~/.cache/pipenv
39+
~/.local/share/virtualenvs
40+
key: ${{ runner.os }}-env-${{ matrix.python-version }}-${{ hashFiles('**/Pipfile.lock') }}-${{ github.ref }}
41+
42+
- name: Install dependencies
43+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
44+
run: |
45+
pipenv install --dev --ignore-pipfile --python ${{ matrix.python-version }}
46+
pipenv run ansible-galaxy collection install community.kubernetes
47+
48+
- name: Run unit tests
49+
run: pipenv run molecule test -s test-local
50+

.yamllint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ extends: default
33

44
# For all rules
55
ignore: |
6+
.github/
67
.tox/
78

89
rules:

Pipfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ pylint = ">=2.4"
1111
pyyaml = ">=5.3"
1212
testinfra = ">=4.0.0"
1313
pytest= ">2.9.1"
14+
jmespath = ">=0.10.0"
15+
openshift = ">=0.11.2"
16+
1417

1518
[packages]
1619
ansible = ">=2.7"
1720
ansible-runner = ">=1.4.4"
1821
ansible-runner-http = ">=1.0.0"
22+
23+
[requires]
24+
python_version = "3.6"

Pipfile.lock

Lines changed: 506 additions & 378 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

molecule/test-local/converge.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,25 @@
2323
copy:
2424
dest: "/tmp/get"
2525
src: 'test_data.csv'
26+
mode: 0666
2627

2728
- name: copy mock_reporting_api server to k8s container
2829
copy:
2930
dest: "/tmp/mock_reporting_api.py"
3031
src: 'mock_reporting_api.py'
32+
mode: 0666
3133

3234
- name: copy mock_reporting_api pem file to k8s container
3335
copy:
3436
dest: "/tmp/mock_reporting_api.pem"
3537
src: 'mock_reporting_api.pem'
38+
mode: 0666
3639

3740
- name: copy mock_ingress_server file to k8s container
3841
copy:
3942
dest: "/tmp/mock_ingress_server.py"
4043
src: 'mock_ingress_server.py'
44+
mode: 0666
4145

4246
- name: Converge on setup
4347
hosts: localhost

0 commit comments

Comments
 (0)