From 013a9278a0ed993fdb410b13cd8054916accfb84 Mon Sep 17 00:00:00 2001 From: Steven Maude Date: Sat, 10 Apr 2021 13:44:27 +0100 Subject: [PATCH 01/14] Add simple test workflow --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..2189d2ae --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Run tests +on: + pull_request: + push: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.7, 3.8, 3.9] + + 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 package + run: pip install . + + - name: Run tests + run: python -m unittest From 75a8f4d966f38c6cd55dd641f87531c64e1fcd83 Mon Sep 17 00:00:00 2001 From: Steven Maude Date: Mon, 12 Apr 2021 17:57:15 +0100 Subject: [PATCH 02/14] Run tests on Windows in addition to Ubuntu Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-additional-values-into-combinations --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2189d2ae..17dcc3ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,10 +7,11 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: python-version: [3.7, 3.8, 3.9] + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v2 From 9be3e0e42695af4bfec58dff5f3278a0e48ed936 Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Wed, 14 Apr 2021 23:13:57 +0200 Subject: [PATCH 03/14] updated test.yml --- .github/workflows/test.yml | 44 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17dcc3ee..aac01a7a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,11 @@ jobs: matrix: python-version: [3.7, 3.8, 3.9] os: [ubuntu-latest, windows-latest] - + include: + - os: ubuntu-latest + ls_name: pwd ; tree . + - os: windows-latest + ls_name: tree /f steps: - uses: actions/checkout@v2 @@ -22,7 +26,43 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install package - run: pip install . + run: pip install -v . + + - name: List packages + if: always() + run: pip list + + - name: Show folder contents + if: always() + run: ${{ matrix.ls_name }} + - if: ${{ ( github.base_ref == 'new_awesome' && matrix.os == 'ubuntu-latest' ) }} + name: Where are the libraries installed? (ubuntu) + run: | + tree -f -a $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/string_grouper + tree -f -a $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/sparse_dot_topn + tree -f -a $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/string_grouper_utils + + - if: ${{ ( github.base_ref == 'new_awesome' && matrix.os == 'windows-latest' ) }} + name: Where are the libraries installed? (windows) + run: | + tree /f %pythonLocation%\Lib\site-packages\string_grouper + tree /f %pythonLocation%\Lib\site-packages\sparse_dot_topn + tree /f %pythonLocation%\Lib\site-packages\string_grouper_utils + shell: cmd + + - if: ${{ ( github.base_ref == 'new_awesome' && matrix.os == 'ubuntu-latest' ) }} + name: Import Python-C++ bindings (ubuntu) + run: | + cp $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/sparse_dot_topn/*.so sparse_dot_topn/ + tree -f -a sparse_dot_topn + + - if: ${{ ( github.base_ref == 'new_awesome' && matrix.os == 'windows-latest' ) }} + name: Import Python-C++ bindings (windows) + run: | + copy %pythonLocation%\Lib\site-packages\sparse_dot_topn\*.pyd sparse_dot_topn\ + tree /f sparse_dot_topn + shell: cmd + - name: Run tests run: python -m unittest From a2e4fd943695ffbbe8ebc2369c5fc138cf1182f5 Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sat, 17 Apr 2021 09:30:59 +0200 Subject: [PATCH 04/14] pip install -e --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aac01a7a..3eb55bd3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install package - run: pip install -v . + run: pip install -v -e . - name: List packages if: always() From 7a4851249b6f9f537994ca257077cec6bed92652 Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sat, 17 Apr 2021 09:33:35 +0200 Subject: [PATCH 05/14] added branch free --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3eb55bd3..26fd214b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,14 +36,14 @@ jobs: if: always() run: ${{ matrix.ls_name }} - - if: ${{ ( github.base_ref == 'new_awesome' && matrix.os == 'ubuntu-latest' ) }} + - if: ${{ ( (github.base_ref == 'new_awesome' || github.base_ref == 'free') && matrix.os == 'ubuntu-latest' ) }} name: Where are the libraries installed? (ubuntu) run: | tree -f -a $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/string_grouper tree -f -a $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/sparse_dot_topn tree -f -a $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/string_grouper_utils - - if: ${{ ( github.base_ref == 'new_awesome' && matrix.os == 'windows-latest' ) }} + - if: ${{ ( (github.base_ref == 'new_awesome' || github.base_ref == 'free') && matrix.os == 'windows-latest' ) }} name: Where are the libraries installed? (windows) run: | tree /f %pythonLocation%\Lib\site-packages\string_grouper @@ -51,13 +51,13 @@ jobs: tree /f %pythonLocation%\Lib\site-packages\string_grouper_utils shell: cmd - - if: ${{ ( github.base_ref == 'new_awesome' && matrix.os == 'ubuntu-latest' ) }} + - if: ${{ ( (github.base_ref == 'new_awesome' || github.base_ref == 'free') && matrix.os == 'ubuntu-latest' ) }} name: Import Python-C++ bindings (ubuntu) run: | cp $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/sparse_dot_topn/*.so sparse_dot_topn/ tree -f -a sparse_dot_topn - - if: ${{ ( github.base_ref == 'new_awesome' && matrix.os == 'windows-latest' ) }} + - if: ${{ ( (github.base_ref == 'new_awesome' || github.base_ref == 'free') && matrix.os == 'windows-latest' ) }} name: Import Python-C++ bindings (windows) run: | copy %pythonLocation%\Lib\site-packages\sparse_dot_topn\*.pyd sparse_dot_topn\ From ee93685237f597067dfb959d253f09c25b22af83 Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sat, 17 Apr 2021 09:40:22 +0200 Subject: [PATCH 06/14] no need for manual library imports --- .github/workflows/test.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 26fd214b..341c7e8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,33 +36,5 @@ jobs: if: always() run: ${{ matrix.ls_name }} - - if: ${{ ( (github.base_ref == 'new_awesome' || github.base_ref == 'free') && matrix.os == 'ubuntu-latest' ) }} - name: Where are the libraries installed? (ubuntu) - run: | - tree -f -a $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/string_grouper - tree -f -a $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/sparse_dot_topn - tree -f -a $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/string_grouper_utils - - - if: ${{ ( (github.base_ref == 'new_awesome' || github.base_ref == 'free') && matrix.os == 'windows-latest' ) }} - name: Where are the libraries installed? (windows) - run: | - tree /f %pythonLocation%\Lib\site-packages\string_grouper - tree /f %pythonLocation%\Lib\site-packages\sparse_dot_topn - tree /f %pythonLocation%\Lib\site-packages\string_grouper_utils - shell: cmd - - - if: ${{ ( (github.base_ref == 'new_awesome' || github.base_ref == 'free') && matrix.os == 'ubuntu-latest' ) }} - name: Import Python-C++ bindings (ubuntu) - run: | - cp $LD_LIBRARY_PATH/python${{ matrix.python-version }}/site-packages/sparse_dot_topn/*.so sparse_dot_topn/ - tree -f -a sparse_dot_topn - - - if: ${{ ( (github.base_ref == 'new_awesome' || github.base_ref == 'free') && matrix.os == 'windows-latest' ) }} - name: Import Python-C++ bindings (windows) - run: | - copy %pythonLocation%\Lib\site-packages\sparse_dot_topn\*.pyd sparse_dot_topn\ - tree /f sparse_dot_topn - shell: cmd - - name: Run tests run: python -m unittest From bd283d06c21ef46f33c2edd629780b6bba21d4da Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sat, 17 Apr 2021 10:11:17 +0200 Subject: [PATCH 07/14] view segfault log --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 341c7e8f..83570c97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,8 +15,10 @@ jobs: include: - os: ubuntu-latest ls_name: pwd ; tree . + cat_command: cat work/* - os: windows-latest ls_name: tree /f + cat_command: cat work\* steps: - uses: actions/checkout@v2 @@ -38,3 +40,7 @@ jobs: - name: Run tests run: python -m unittest + + - name: If tests failed + if: ${{ failure() }} + run: ${{ matrix.cat_command }} From 81848ac2af7810d97ba319ffba8bd7005e9a21df Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sat, 17 Apr 2021 10:16:28 +0200 Subject: [PATCH 08/14] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83570c97..56c676f6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,10 +15,10 @@ jobs: include: - os: ubuntu-latest ls_name: pwd ; tree . - cat_command: cat work/* + cat_command: cat ./work/_temp/* - os: windows-latest ls_name: tree /f - cat_command: cat work\* + cat_command: cat .\work\_temp\* steps: - uses: actions/checkout@v2 From dd9926a491f40294c173cc1561d03dbffd93535b Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sat, 17 Apr 2021 10:20:52 +0200 Subject: [PATCH 09/14] Update test.yml --- .github/workflows/test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 56c676f6..41c0c96c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,8 +39,5 @@ jobs: run: ${{ matrix.ls_name }} - name: Run tests - run: python -m unittest - - - name: If tests failed - if: ${{ failure() }} - run: ${{ matrix.cat_command }} + run: | + python -m unittest || ${{ matrix.cat_command }} From 6c62f23c99948f94d5d5e2a56436f3e01b4a2b4a Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sat, 17 Apr 2021 10:24:26 +0200 Subject: [PATCH 10/14] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 41c0c96c..4b4b17be 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: include: - os: ubuntu-latest ls_name: pwd ; tree . - cat_command: cat ./work/_temp/* + cat_command: cat /home/runner/work/_temp/* - os: windows-latest ls_name: tree /f cat_command: cat .\work\_temp\* From 1a87c932e12870a69f06883a407c5d899d2adb2e Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sun, 18 Apr 2021 20:34:00 +0200 Subject: [PATCH 11/14] Update test.yml --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b4b17be..fb21c7e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,5 +39,4 @@ jobs: run: ${{ matrix.ls_name }} - name: Run tests - run: | - python -m unittest || ${{ matrix.cat_command }} + run: python -m unittest From f5f1f887f3c1f7fb19c61ee38011f860fcc44c14 Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sun, 25 Apr 2021 14:27:35 +0200 Subject: [PATCH 12/14] use pytest for branch new_awesome --- .github/workflows/test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fb21c7e9..249b96f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,5 +38,12 @@ jobs: if: always() run: ${{ matrix.ls_name }} - - name: Run tests + - if: ${{ ( github.base_ref == 'new_awesome' ) }} + name: Run tests + run: | + pip install pytest + pytest -ra . + + - if: ${{ ( github.base_ref != 'new_awesome' ) }} + name: Run tests run: python -m unittest From aa6194334521e687fe46beea5099369f2847143c Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sun, 25 Apr 2021 17:04:26 +0200 Subject: [PATCH 13/14] Update test.yml From 87c2ab64dcfe426b159086a01c802077b9ca639e Mon Sep 17 00:00:00 2001 From: ParticularMiner <78448465+ParticularMiner@users.noreply.github.com> Date: Sun, 25 Apr 2021 17:11:56 +0200 Subject: [PATCH 14/14] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 249b96f4..17425b0f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,12 +38,12 @@ jobs: if: always() run: ${{ matrix.ls_name }} - - if: ${{ ( github.base_ref == 'new_awesome' ) }} + - if: ${{ ( github.base_ref == 'new_awesome' || github.base_ref == 'free' ) }} name: Run tests run: | pip install pytest pytest -ra . - - if: ${{ ( github.base_ref != 'new_awesome' ) }} + - if: ${{ ( github.base_ref != 'new_awesome' && github.base_ref != 'free' ) }} name: Run tests run: python -m unittest