From ffe3ae76b615d105229378597cf8e9940c2efa81 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 10:58:38 -0600 Subject: [PATCH 01/12] updated readme --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 85acbac..332cf7a 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ pip install git@github.com:watakandai/specless.git curl -sSL https://install.python-poetry.org | python3 - ``` -### +### Install specless & dependencies ```bash # Clone locally @@ -50,9 +50,8 @@ cd specless # Activate the virtual environment python -m venv env source env/bin/activate -# Install +# Install specless & dependencies poetry install -# ``` Done! From 3c9365d895d0e354ccca18e6cbf546b554a186b3 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 11:02:45 -0600 Subject: [PATCH 02/12] added test.yml --- .github/workflows/test.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 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..6d6720a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: '🧪 Test' + +on: + workflow_dispatch: + push: + pull_request: + +jobs: + py-test: + uses: ./.github/workflows/tox-pytest.yml + with: + enable-test: true + +# determine-changes: +# if: | +# github.event_name != 'pull_request' || +# github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name +# runs-on: ubuntu-latest +# outputs: +# has-changes: ${{ fromJson(steps.filter.outputs.changes)[0] != null }} +# py: ${{ steps.filter.outputs.py }} +# py-test: ${{ steps.filter.outputs.py-test }} +# steps: +# - name: Checkout +# uses: actions/checkout@v3 + +# - name: Categorize changed files +# uses: dorny/paths-filter@v2 +# id: filter +# with: +# filters: .github/settings/test-filters.yml From 79a2f148ae88d2341c5ecec9c982d09316ddc7a5 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 11:11:04 -0600 Subject: [PATCH 03/12] fixed setup-poetry action.yml --- .github/actions/setup-poetry/action.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/actions/setup-poetry/action.yml b/.github/actions/setup-poetry/action.yml index b3c8c93..47597b5 100644 --- a/.github/actions/setup-poetry/action.yml +++ b/.github/actions/setup-poetry/action.yml @@ -48,3 +48,15 @@ runs: - name: Install Poetry for Windows if: runner.os == 'Windows' && steps.cached-poetry.outputs.cache-hit != 'true' + shell: pwsh + env: + POETRY_VERSION: ${{ inputs.poetry-version }} + POETRY_HOME: ${{ inputs.poetry-home }} + run: | + (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py - + + - name: Add Poetry to the PATH environment variable + if: inputs.poetry-path != '' + shell: bash + run: | + echo "${{ inputs.poetry-path }}" >> $GITHUB_PATH From ca5c94dfb31b6cb8f03387fb5143f8efe82e99a0 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 11:13:11 -0600 Subject: [PATCH 04/12] updated poetry version --- .github/workflows/tox-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index e3ca39e..8e38538 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -27,7 +27,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ['3.7', '3.8', '3.9', '3.10'] - poetry_version: ['1.3.1'] + poetry_version: ['1.8.3'] include: - os: ubuntu-latest poetry_home: '' From 0ab05a0b1a8a2db2100b9550675b764c3059c387 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 11:16:10 -0600 Subject: [PATCH 05/12] fixed github action path and removed support for python 3.7 --- .../action.yml | 0 .github/workflows/tox-pytest.yml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/actions/{setup-poetry-depencies => setup-poetry-dependencies}/action.yml (100%) diff --git a/.github/actions/setup-poetry-depencies/action.yml b/.github/actions/setup-poetry-dependencies/action.yml similarity index 100% rename from .github/actions/setup-poetry-depencies/action.yml rename to .github/actions/setup-poetry-dependencies/action.yml diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index 8e38538..6a5f11a 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.8', '3.9', '3.10'] poetry_version: ['1.8.3'] include: - os: ubuntu-latest From ae489d00c14820155f4eba4f43cb1ec5b83c4432 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 11:26:09 -0600 Subject: [PATCH 06/12] fixed poetry version --- .github/workflows/tox-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index 6a5f11a..56b6aaa 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -27,7 +27,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] python-version: ['3.8', '3.9', '3.10'] - poetry_version: ['1.8.3'] + poetry-version: ['1.8.3'] include: - os: ubuntu-latest poetry_home: '' From 52f2517fe21c72fc62669f4052862205f48bbbe9 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 11:29:02 -0600 Subject: [PATCH 07/12] updated tox command in tox-pytest.yml --- .github/workflows/tox-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index 56b6aaa..04cd474 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -93,7 +93,7 @@ jobs: if: inputs.enable-test == true run: | ${{ steps.setup-poetry-dependencies.outputs.venv-activate }} - tox -v + tox -e py -- -v # tox -e py -- -v --color=yes # deactivate # # Create a dummy file. From 981db30dee40560e285bccff35a9d445b146cbc5 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 12:06:05 -0600 Subject: [PATCH 08/12] fixed important typos to fix GithubActions on windows and linux --- .github/workflows/tox-pytest.yml | 39 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index 04cd474..e258dcc 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -26,25 +26,26 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8', '3.9', '3.10'] + python-version: ['3.8'] + # python-version: ['3.8', '3.9', '3.10'] poetry-version: ['1.8.3'] include: - os: ubuntu-latest - poetry_home: '' - poetry_path: '' - poetry_cache_paths: | + poetry-home: '' + poetry-path: '' + poetry-cache-paths: | ~/.local/share/pypoetry ~/.local/bin/poetry - os: macos-latest - poetry_home: '' - poetry_path: ${HOME}/.local/bin - poetry_cache_paths: | + poetry-home: '' + poetry-path: ${HOME}/.local/bin + poetry-cache-paths: | ~/Library/Application Support/pypoetry ~/.local/bin/poetry - os: windows-latest - poetry_home: '' - poetry_path: ${APPDATA}\pypoetry\venv\Scripts - poetry_cache_paths: | + poetry-home: '' + poetry-path: ${APPDATA}\pypoetry\venv\Scripts + poetry-cache-paths: | ~\AppData\Roaming\pypoetry ~\AppData\Roaming\Python\Scripts\poetry.exe poetry-cache-key-fmt: ['poetry-{0}-{1}-python-{2}'] @@ -86,7 +87,7 @@ jobs: with: cache-key: ${{ format(matrix.venv-cache-key-fmt, matrix.os, steps.setup-python.outputs.python-version, hashFiles('**/poetry.lock')) }} python-version: ${{ steps.setup-python.outputs.python-version }} - poetry-install-args: --no-interaction --no-root --with dev + poetry-install-args: --no-interaction --with dev - name: Test with pytest id: test-with-pytest @@ -94,10 +95,6 @@ jobs: run: | ${{ steps.setup-poetry-dependencies.outputs.venv-activate }} tox -e py -- -v - # tox -e py -- -v --color=yes - # deactivate - # # Create a dummy file. - # touch "dummy-$(echo .coverage.*)" - name: Upload coverage reports if: steps.test-with-pytest.conclusion != 'skipped' && matrix.enable-coverage == 'true' @@ -107,11 +104,15 @@ jobs: path: .coverage.* retention-days: 1 - - name: Get Total Coverage from coverage.json - if: steps.test-with-pytest.conclusion != 'skipped' && matrix.enable-coverage == 'true' + - name: "Export Coverage Percentage" + id: report-coverage + if: inputs.enable-test == true run: | - export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") - echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY + ${{ steps.setup-poetry-dependencies.outputs.venv-activate }} + tox -e report + export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") + echo "total=$TOTAL" >> $GITHUB_ENV + echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY - name: "Make badge" uses: schneegans/dynamic-badges-action@v1.4.0 From ff5080b2510efca5dc622237c26c3b79ba4e3eff Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 12:14:58 -0600 Subject: [PATCH 09/12] updated the badge action version --- .github/workflows/tox-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index e258dcc..87d9ee7 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -115,7 +115,7 @@ jobs: echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY - name: "Make badge" - uses: schneegans/dynamic-badges-action@v1.4.0 + uses: schneegans/dynamic-badges-action@v1.7.0 with: # GIST_TOKEN is a GitHub personal access token with scope "gist". auth: ${{ secrets.GIST_TOKEN }} From d78de173929ce224ef2f6bd35acc2d010a4b161f Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 12:50:42 -0600 Subject: [PATCH 10/12] skip make badge action for now --- .github/workflows/tox-pytest.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index 87d9ee7..54eb121 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -114,18 +114,18 @@ jobs: echo "total=$TOTAL" >> $GITHUB_ENV echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY - - name: "Make badge" - uses: schneegans/dynamic-badges-action@v1.7.0 - with: - # GIST_TOKEN is a GitHub personal access token with scope "gist". - auth: ${{ secrets.GIST_TOKEN }} - gistID: 5f5c84f28e80b29f2f9ce92300859446 # replace with your real Gist id. - filename: covbadge.json - label: Coverage - message: ${{ env.total }}% - minColorRange: 50 - maxColorRange: 90 - valColorRange: ${{ env.total }} + # - name: "Make badge" + # uses: schneegans/dynamic-badges-action@v1.7.0 + # with: + # # GIST_TOKEN is a GitHub personal access token with scope "gist". + # auth: ${{ secrets.GIST_TOKEN }} + # gistID: 5f5c84f28e80b29f2f9ce92300859446 # replace with your real Gist id. + # filename: covbadge.json + # label: Coverage + # message: ${{ env.total }}% + # minColorRange: 50 + # maxColorRange: 90 + # valColorRange: ${{ env.total }} - name: Upload dummy files if: steps.test-with-pytest.conclusion != 'skipped' && matrix.enable-coverage == 'true' From 67a113417b15fcf3fc7e6b1c20ff3efffeb726d9 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 12:51:15 -0600 Subject: [PATCH 11/12] trying python 3.9 to see if windows pass the test --- .github/workflows/tox-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index 54eb121..bea76d6 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -26,7 +26,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.8'] + python-version: ['3.9'] # python-version: ['3.8', '3.9', '3.10'] poetry-version: ['1.8.3'] include: From 3c10da10e05e6379483468c0d4cb6bd22a2586c7 Mon Sep 17 00:00:00 2001 From: Kandai Watanabe Date: Tue, 23 Jul 2024 12:59:00 -0600 Subject: [PATCH 12/12] test python 3.8 3.9 3.10 on ubuntu and mac --- .github/workflows/tox-pytest.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tox-pytest.yml b/.github/workflows/tox-pytest.yml index bea76d6..9167822 100644 --- a/.github/workflows/tox-pytest.yml +++ b/.github/workflows/tox-pytest.yml @@ -25,9 +25,10 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.9'] - # python-version: ['3.8', '3.9', '3.10'] + # os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest] + # python-version: ['3.9'] + python-version: ['3.8', '3.9', '3.10'] poetry-version: ['1.8.3'] include: - os: ubuntu-latest