From 8378ca956dafeb4f4b7dbcb331d18d4fc86110fb Mon Sep 17 00:00:00 2001 From: Rose Cooper Date: Thu, 17 Jun 2021 15:47:40 +0000 Subject: [PATCH 01/13] Add SSM GitHub Actions YAML file --- .github/workflows/ssm_actions.yml | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/ssm_actions.yml diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml new file mode 100644 index 00000000..35415691 --- /dev/null +++ b/.github/workflows/ssm_actions.yml @@ -0,0 +1,40 @@ +name: Test_action + +on: + push: + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.7] + + steps: + - name: Checkout code + run: actions/checkout@v2 + - name: Base requirements for SSM + run: pip install -r requirements.txt + - name: Additional requirements for the unit and coverage tests + run: pip install -r requirements-test.txt + - name: before_script + run: export TMPDIR=$PWD/tmp + mkdir $TMPDIR + export PYTHONPATH=$PYTHONPATH:`pwd -P` + cd test + - name: script + run: coverage run --branch --source=ssm,bin -m unittest discover --buffer + + - name: upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml,./coverage.xml + directory: ./coverage/reports/ + flags: unittests + env_vars: OS,PYTHON + name: codecov-umberella + fail_ci_if_error: true + path_to_write_report: ./coverage/codecov_report.txt + verbose: true \ No newline at end of file From dbfcad120362573a336ffff606b31cf52c19ebd6 Mon Sep 17 00:00:00 2001 From: Rose Cooper Date: Thu, 17 Jun 2021 16:25:51 +0000 Subject: [PATCH 02/13] Just use python 2.7 and code from actions wizard --- .github/workflows/ssm_actions.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml index 35415691..d929ed6b 100644 --- a/.github/workflows/ssm_actions.yml +++ b/.github/workflows/ssm_actions.yml @@ -1,17 +1,21 @@ name: Test_action -on: - push: +on: [push,pull_request] + #push: + # branches: + # - dev + # pull_request: + # branches: + # - dev jobs: build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [2.7, 3.7] - steps: + - name: Set up Python 2.7 + uses: actions/setup-python@v2 + with: + python-version: 2.7 - name: Checkout code run: actions/checkout@v2 - name: Base requirements for SSM From 304a1b6af36be96549a2933d3e510d9efcc4d732 Mon Sep 17 00:00:00 2001 From: Rose Cooper Date: Thu, 17 Jun 2021 16:31:22 +0000 Subject: [PATCH 03/13] Change code checkout command --- .github/workflows/ssm_actions.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml index d929ed6b..d525bb76 100644 --- a/.github/workflows/ssm_actions.yml +++ b/.github/workflows/ssm_actions.yml @@ -1,7 +1,7 @@ name: Test_action on: [push,pull_request] - #push: + # push: # branches: # - dev # pull_request: @@ -10,14 +10,15 @@ on: [push,pull_request] jobs: build: + runs-on: ubuntu-latest + steps: - - name: Set up Python 2.7 + - uses: actions/checkout@v2 + - name: Set up Python 2.7 uses: actions/setup-python@v2 with: python-version: 2.7 - - name: Checkout code - run: actions/checkout@v2 - name: Base requirements for SSM run: pip install -r requirements.txt - name: Additional requirements for the unit and coverage tests From 7c99f7839970612a3c93d12d37959baca40e1cfc Mon Sep 17 00:00:00 2001 From: Rose Cooper Date: Thu, 17 Jun 2021 16:38:17 +0000 Subject: [PATCH 04/13] Realign tabs --- .github/workflows/ssm_actions.yml | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml index d525bb76..929bced5 100644 --- a/.github/workflows/ssm_actions.yml +++ b/.github/workflows/ssm_actions.yml @@ -14,32 +14,32 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 2.7 + - uses: actions/checkout@v2 + - name: Set up Python uses: actions/setup-python@v2 with: python-version: 2.7 - - name: Base requirements for SSM - run: pip install -r requirements.txt - - name: Additional requirements for the unit and coverage tests - run: pip install -r requirements-test.txt - - name: before_script - run: export TMPDIR=$PWD/tmp - mkdir $TMPDIR - export PYTHONPATH=$PYTHONPATH:`pwd -P` - cd test - - name: script - run: coverage run --branch --source=ssm,bin -m unittest discover --buffer + - name: Base requirements for SSM + run: pip install -r requirements.txt + - name: Additional requirements for the unit and coverage tests + run: pip install -r requirements-test.txt + - name: before_script + run: export TMPDIR=$PWD/tmp + mkdir $TMPDIR + export PYTHONPATH=$PYTHONPATH:`pwd -P` + cd test + - name: script + run: coverage run --branch --source=ssm,bin -m unittest discover --buffer - - name: upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml,./coverage.xml - directory: ./coverage/reports/ - flags: unittests - env_vars: OS,PYTHON - name: codecov-umberella - fail_ci_if_error: true - path_to_write_report: ./coverage/codecov_report.txt - verbose: true \ No newline at end of file + - name: upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml,./coverage.xml + directory: ./coverage/reports/ + flags: unittests + env_vars: OS,PYTHON + name: codecov-umberella + fail_ci_if_error: true + path_to_write_report: ./coverage/codecov_report.txt + verbose: true \ No newline at end of file From f08ff6ef3f299240eb094aaab99567a9416eb9e2 Mon Sep 17 00:00:00 2001 From: Rose Cooper Date: Thu, 17 Jun 2021 16:48:02 +0000 Subject: [PATCH 05/13] Fix coverage commands --- .github/workflows/ssm_actions.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml index 929bced5..f345771e 100644 --- a/.github/workflows/ssm_actions.yml +++ b/.github/workflows/ssm_actions.yml @@ -28,18 +28,7 @@ jobs: mkdir $TMPDIR export PYTHONPATH=$PYTHONPATH:`pwd -P` cd test - - name: script + - name: coverage script run: coverage run --branch --source=ssm,bin -m unittest discover --buffer - - - name: upload coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml,./coverage.xml - directory: ./coverage/reports/ - flags: unittests - env_vars: OS,PYTHON - name: codecov-umberella - fail_ci_if_error: true - path_to_write_report: ./coverage/codecov_report.txt - verbose: true \ No newline at end of file + - name: post test summary + run: codecov \ No newline at end of file From 350a764588a6303e69af045dd667e63ac9151334 Mon Sep 17 00:00:00 2001 From: Rose Cooper Date: Wed, 23 Jun 2021 14:24:41 +0000 Subject: [PATCH 06/13] Install extra dependencies --- .github/workflows/ssm_actions.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml index f345771e..346504cf 100644 --- a/.github/workflows/ssm_actions.yml +++ b/.github/workflows/ssm_actions.yml @@ -19,6 +19,8 @@ jobs: uses: actions/setup-python@v2 with: python-version: 2.7 + - name: Set up dependencies + run: sudo apt-get install libsasl2-dev libldap2-dev libssl-dev - name: Base requirements for SSM run: pip install -r requirements.txt - name: Additional requirements for the unit and coverage tests From 1e088695c4c0d535b8d8a039073a70727bf4b0f5 Mon Sep 17 00:00:00 2001 From: Rose Cooper Date: Wed, 23 Jun 2021 14:59:45 +0000 Subject: [PATCH 07/13] Tidy up ssm_actions --- .github/workflows/ssm_actions.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml index 346504cf..05160da2 100644 --- a/.github/workflows/ssm_actions.yml +++ b/.github/workflows/ssm_actions.yml @@ -1,12 +1,6 @@ name: Test_action on: [push,pull_request] - # push: - # branches: - # - dev - # pull_request: - # branches: - # - dev jobs: build: @@ -19,18 +13,18 @@ jobs: uses: actions/setup-python@v2 with: python-version: 2.7 - - name: Set up dependencies + - name: Set up dependencies for python-ldap run: sudo apt-get install libsasl2-dev libldap2-dev libssl-dev - name: Base requirements for SSM run: pip install -r requirements.txt - name: Additional requirements for the unit and coverage tests run: pip install -r requirements-test.txt - - name: before_script + - name: Pre-test set up run: export TMPDIR=$PWD/tmp mkdir $TMPDIR export PYTHONPATH=$PYTHONPATH:`pwd -P` cd test - - name: coverage script + - name: Run unit tests run: coverage run --branch --source=ssm,bin -m unittest discover --buffer - - name: post test summary + - name: Push coverage results to codecov run: codecov \ No newline at end of file From c061ddedfa6327c08ac220a47b5cdbf436351ea7 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 24 Jun 2021 15:40:47 +0100 Subject: [PATCH 08/13] Tidy up formatting --- .github/workflows/ssm_actions.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml index 05160da2..6c28ad88 100644 --- a/.github/workflows/ssm_actions.yml +++ b/.github/workflows/ssm_actions.yml @@ -1,10 +1,9 @@ -name: Test_action +name: Run Unit Tests -on: [push,pull_request] +on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest steps: @@ -20,10 +19,11 @@ jobs: - name: Additional requirements for the unit and coverage tests run: pip install -r requirements-test.txt - name: Pre-test set up - run: export TMPDIR=$PWD/tmp - mkdir $TMPDIR - export PYTHONPATH=$PYTHONPATH:`pwd -P` - cd test + run: | + export TMPDIR=$PWD/tmp + mkdir $TMPDIR + export PYTHONPATH=$PYTHONPATH:`pwd -P` + cd test - name: Run unit tests run: coverage run --branch --source=ssm,bin -m unittest discover --buffer - name: Push coverage results to codecov From 2e368f27becb63cbaf0f56364f5746b250994f37 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 24 Jun 2021 15:41:04 +0100 Subject: [PATCH 09/13] Change to using Action for codecov upload --- .github/workflows/ssm_actions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml index 6c28ad88..9f427917 100644 --- a/.github/workflows/ssm_actions.yml +++ b/.github/workflows/ssm_actions.yml @@ -26,5 +26,5 @@ jobs: cd test - name: Run unit tests run: coverage run --branch --source=ssm,bin -m unittest discover --buffer - - name: Push coverage results to codecov - run: codecov \ No newline at end of file + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 From b0b200fdd465f83bb605c9a8b2dea6803a2303c7 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 24 Jun 2021 16:20:08 +0100 Subject: [PATCH 10/13] Add Python 3 to matrix --- .github/workflows/ssm_actions.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/ssm_actions.yml index 9f427917..5a85045f 100644 --- a/.github/workflows/ssm_actions.yml +++ b/.github/workflows/ssm_actions.yml @@ -5,13 +5,16 @@ on: [push, pull_request] jobs: build: runs-on: ubuntu-latest - + strategy: + matrix: + python-version: ['2.x', '3.x'] + name: Python ${{ matrix.python-version }} test steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 2.7 + python-version: ${{ matrix.python-version }} - name: Set up dependencies for python-ldap run: sudo apt-get install libsasl2-dev libldap2-dev libssl-dev - name: Base requirements for SSM From 66d94680a1dee2ba1d2a5ceb99b5b85690161449 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 24 Jun 2021 16:23:54 +0100 Subject: [PATCH 11/13] Rename unit-test workflow file --- .github/workflows/{ssm_actions.yml => unit-test.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{ssm_actions.yml => unit-test.yml} (100%) diff --git a/.github/workflows/ssm_actions.yml b/.github/workflows/unit-test.yml similarity index 100% rename from .github/workflows/ssm_actions.yml rename to .github/workflows/unit-test.yml From af6013fd712193562ee2c07606fc227c80e05038 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 24 Jun 2021 16:27:51 +0100 Subject: [PATCH 12/13] Rename job to reflect process --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 5a85045f..c018d20b 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -3,7 +3,7 @@ name: Run Unit Tests on: [push, pull_request] jobs: - build: + unit-test: runs-on: ubuntu-latest strategy: matrix: From c9994b48dda2b951781afc078c7c96c82136a796 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Thu, 24 Jun 2021 16:52:04 +0100 Subject: [PATCH 13/13] Pin to Ubuntu 18.04 --- .github/workflows/unit-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index c018d20b..3407bf50 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: unit-test: - runs-on: ubuntu-latest + runs-on: ubuntu-18.04 strategy: matrix: python-version: ['2.x', '3.x']