From 2384046e663297efa5124cbe90ef48c91ef7ea74 Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Thu, 25 Jul 2024 16:51:00 +0200 Subject: [PATCH 01/11] Try automated testing --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 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 0000000..155e5dd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +name: Python application +on: + push: + branches: [ "testing_ci" ] + pull_request: + branches: [ "testing_ci" ] +permissions: + contents: read +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements_tests.txt ]; then pip install -r requirements_tests.txt; fi + - name: Build package + run: python -m build + - name: Publish artifacts + uses: actions/upload-artifact@v2 + with: + name: python-package + path: dist/ + - name: Download and install package + run: | + mkdir -p dist + curl -L ${{ steps.build.outputs.artifacts_url }}/python-package.tar.gz | tar xz -C dist + pip install dist/*.whl + - name: Run tests with pytest + run: pytest test + From 9b2320e88c0f59790e5c4064ed74e41f6ca57c7c Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Thu, 25 Jul 2024 17:00:44 +0200 Subject: [PATCH 02/11] Add requirements for automated tests --- requirement_tests.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 requirement_tests.txt diff --git a/requirement_tests.txt b/requirement_tests.txt new file mode 100644 index 0000000..b42bb1d --- /dev/null +++ b/requirement_tests.txt @@ -0,0 +1,5 @@ +numpy>1.26.0, <2.0.0 +numba>0.59, <1.0.0 +scipy +scikit-learn +build \ No newline at end of file From 9838443dca8b433dd3618d46b29a83f6756560de Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Thu, 25 Jul 2024 17:02:19 +0200 Subject: [PATCH 03/11] Rename file --- requirement_tests.txt => requirements_tests.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename requirement_tests.txt => requirements_tests.txt (100%) diff --git a/requirement_tests.txt b/requirements_tests.txt similarity index 100% rename from requirement_tests.txt rename to requirements_tests.txt From c6a5f2de9c81de03edec8cd6997089ad8e59e0c4 Mon Sep 17 00:00:00 2001 From: Simon Hirsch <64348015+simon-hirsch@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:29:52 +0200 Subject: [PATCH 04/11] Update test.yml --- .github/workflows/test.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 155e5dd..3dbf09a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,17 +21,9 @@ jobs: pip install flake8 pytest if [ -f requirements_tests.txt ]; then pip install -r requirements_tests.txt; fi - name: Build package - run: python -m build - - name: Publish artifacts - uses: actions/upload-artifact@v2 - with: - name: python-package - path: dist/ - - name: Download and install package - run: | - mkdir -p dist - curl -L ${{ steps.build.outputs.artifacts_url }}/python-package.tar.gz | tar xz -C dist - pip install dist/*.whl + run: python -m build --wheel + - name: Install Package + pip install dist/* - name: Run tests with pytest run: pytest test From 8cedfd8170a0ed34c3ee0fa7e2e7f0f888125b28 Mon Sep 17 00:00:00 2001 From: Simon Hirsch <64348015+simon-hirsch@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:30:49 +0200 Subject: [PATCH 05/11] 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 3dbf09a..daa540c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Build package run: python -m build --wheel - name: Install Package - pip install dist/* + run: pip install dist/* - name: Run tests with pytest run: pytest test From 81876a03107dffcfbbc62ede57397b8edd4356ca Mon Sep 17 00:00:00 2001 From: Simon Hirsch <64348015+simon-hirsch@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:36:08 +0200 Subject: [PATCH 06/11] 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 daa540c..c3c1ef9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,5 +25,5 @@ jobs: - name: Install Package run: pip install dist/* - name: Run tests with pytest - run: pytest test + run: pytest tests From a9aa6f73d621d1c383c9bd6a2503c899744e6fc0 Mon Sep 17 00:00:00 2001 From: Simon Hirsch <64348015+simon-hirsch@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:38:49 +0200 Subject: [PATCH 07/11] 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 c3c1ef9..fba0d56 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,9 @@ name: Python application on: push: - branches: [ "testing_ci" ] + branches: [ "main" ] pull_request: - branches: [ "testing_ci" ] + branches: [ "main" ] permissions: contents: read jobs: From 6a491be3b3b140491fbd2f960d5e20fd436d533f Mon Sep 17 00:00:00 2001 From: Simon Hirsch <64348015+simon-hirsch@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:39:17 +0200 Subject: [PATCH 08/11] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7680bf0..2160a33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: ci +name: Automated Tests on: push: branches: From 3830d094515bb317030e0a9fbc86db6d94f23d5b Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Thu, 25 Jul 2024 17:44:09 +0200 Subject: [PATCH 09/11] Rename files --- .../workflows/{ci.yml => ci_run_tests.yml} | 2 +- .github/workflows/test.yml | 29 ------------------- 2 files changed, 1 insertion(+), 30 deletions(-) rename .github/workflows/{ci.yml => ci_run_tests.yml} (95%) delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci_run_tests.yml similarity index 95% rename from .github/workflows/ci.yml rename to .github/workflows/ci_run_tests.yml index 2160a33..5a76bde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci_run_tests.yml @@ -26,4 +26,4 @@ jobs: mkdocs-material- - run: pip install mkdocs-material - run: pip install "mkdocstrings[python]" - - run: mkdocs gh-deploy --force + - run: mkdocs gh-deploy --force \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index fba0d56..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Python application -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] -permissions: - contents: read -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.10 - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements_tests.txt ]; then pip install -r requirements_tests.txt; fi - - name: Build package - run: python -m build --wheel - - name: Install Package - run: pip install dist/* - - name: Run tests with pytest - run: pytest tests - From 9972b8b5a16b93fc24f3bdf8f1e99e0d37b6442a Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Thu, 25 Jul 2024 17:47:42 +0200 Subject: [PATCH 10/11] Update tests --- .github/workflows/ci_run_tests.yml | 41 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci_run_tests.yml b/.github/workflows/ci_run_tests.yml index 5a76bde..776bf10 100644 --- a/.github/workflows/ci_run_tests.yml +++ b/.github/workflows/ci_run_tests.yml @@ -1,29 +1,28 @@ -name: Automated Tests +name: Automated Tests on: push: - branches: - - main + branches: [ "main" ] + pull_request: + branches: [ "main" ] permissions: - contents: write + contents: read jobs: - deploy: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Configure Git Credentials - run: | - git config user.name github-actions[bot] - git config user.email 41898282+github-actions[bot]@users.noreply.github.com - - uses: actions/setup-python@v5 - with: - python-version: 3.x - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - key: mkdocs-material-${{ env.cache_id }} - path: .cache - restore-keys: | - mkdocs-material- - - run: pip install mkdocs-material - - run: pip install "mkdocstrings[python]" - - run: mkdocs gh-deploy --force \ No newline at end of file + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements_tests.txt ]; then pip install -r requirements_tests.txt; fi + - name: Build package + run: python -m build --wheel + - name: Install Package + run: pip install dist/* + - name: Run tests with pytest + run: pytest tests \ No newline at end of file From 759caff17f5790348a26bbadba1741a03d22b9de Mon Sep 17 00:00:00 2001 From: simon-hirsch Date: Thu, 25 Jul 2024 17:49:39 +0200 Subject: [PATCH 11/11] Build docs --- .github/workflows/ci_build_docs.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci_build_docs.yml diff --git a/.github/workflows/ci_build_docs.yml b/.github/workflows/ci_build_docs.yml new file mode 100644 index 0000000..e5c31b0 --- /dev/null +++ b/.github/workflows/ci_build_docs.yml @@ -0,0 +1,29 @@ +name: Build Docs +on: + push: + branches: + - main +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material + - run: pip install "mkdocstrings[python]" + - run: mkdocs gh-deploy --force