From 8772255cd413e13bc7acca0ecf6776800be94991 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sun, 22 Oct 2023 21:58:49 +0000 Subject: [PATCH 1/5] Fixing naming issue with ISSUE_TEMPLATE --- .github/{ISSUE_TEMPLATES => ISSUE_TEMPLATE}/bug_report.yaml | 0 .github/{ISSUE_TEMPLATES => ISSUE_TEMPLATE}/enhancement.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/{ISSUE_TEMPLATES => ISSUE_TEMPLATE}/bug_report.yaml (100%) rename .github/{ISSUE_TEMPLATES => ISSUE_TEMPLATE}/enhancement.yaml (100%) diff --git a/.github/ISSUE_TEMPLATES/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml similarity index 100% rename from .github/ISSUE_TEMPLATES/bug_report.yaml rename to .github/ISSUE_TEMPLATE/bug_report.yaml diff --git a/.github/ISSUE_TEMPLATES/enhancement.yaml b/.github/ISSUE_TEMPLATE/enhancement.yaml similarity index 100% rename from .github/ISSUE_TEMPLATES/enhancement.yaml rename to .github/ISSUE_TEMPLATE/enhancement.yaml From 87be57de5ee08d25fa93d2770a71c85af786ed07 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sun, 22 Oct 2023 22:02:18 +0000 Subject: [PATCH 2/5] Add missing codecoverage action --- .github/workflows/cicd.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index c9359d3..e669bd9 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -26,4 +26,9 @@ jobs: run: flake8 . - name: ๐Ÿงช Run unit tests - run: pytest # Replace with the command to run your tests \ No newline at end of file + run: pytest # Replace with the command to run your tests + + - name: โ˜‚๏ธ Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file From 9ae208c983400db7cf0b5c10447ddbaf9762a970 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sun, 22 Oct 2023 22:04:09 +0000 Subject: [PATCH 3/5] Replace template string with actual repo --- .github/workflows/release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 19ab247..07d0890 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest environment: name: pypi - url: https://pypi.org/p/ # Replace with your PyPI project name + url: https://pypi.org/p/bookshelf-cli permissions: id-token: write # IMPORTANT: mandatory for trusted publishing @@ -92,7 +92,7 @@ jobs: environment: name: testpypi - url: https://test.pypi.org/p/ + url: https://pypi.org/p/bookshelf-cli permissions: id-token: write # IMPORTANT: mandatory for trusted publishing From d2fcf2b5156394971b0f6ede88c1bc8b52fab8b8 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sun, 22 Oct 2023 22:09:03 +0000 Subject: [PATCH 4/5] Remove upload to testpypi --- .github/workflows/release.yaml | 83 +--------------------------------- 1 file changed, 1 insertion(+), 82 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 07d0890..47cdd75 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -25,85 +25,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: python-package-distributions - path: dist/ - - publish-to-pypi: - name: >- - ๐Ÿš€ Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes - needs: - - build - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/bookshelf-cli - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - - steps: - - name: ๐Ÿ“ฅ Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: ๐Ÿš€ Publish distribution ๐Ÿ“ฆ to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - - github-release: - name: >- - โœ’๏ธ Sign the Python ๐Ÿ distribution ๐Ÿ“ฆ with Sigstore - and upload them to GitHub Release - needs: - - publish-to-pypi - runs-on: ubuntu-latest - - permissions: - contents: write # IMPORTANT: mandatory for making GitHub Releases - id-token: write # IMPORTANT: mandatory for sigstore - - steps: - - name: ๐Ÿ“ฅ Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: โœ’๏ธ Sign the dists with Sigstore - uses: sigstore/gh-action-sigstore-python@v1.2.3 - with: - inputs: >- - ./dist/*.tar.gz - ./dist/*.whl - - name: ๐Ÿท๏ธ Upload artifact signatures to GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - # Upload to GitHub Release using the `gh` CLI. - # `dist/` contains the built packages, and the - # sigstore-produced signatures and certificates. - run: >- - gh release upload - '${{ github.ref_name }}' dist/** - --repo '${{ github.repository }}' - - publish-to-testpypi: - name: ๐Ÿš€ Publish Python ๐Ÿ distribution ๐Ÿ“ฆ to TestPyPI - needs: - - build - runs-on: ubuntu-latest - - environment: - name: testpypi - url: https://pypi.org/p/bookshelf-cli - - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - - steps: - - name: ๐Ÿ“ฅ Download all the dists - uses: actions/download-artifact@v3 - with: - name: python-package-distributions - path: dist/ - - name: ๐Ÿš€ Publish distribution ๐Ÿ“ฆ to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + path: dist/ \ No newline at end of file From f7e6789dfad646a8c4f4cad810eb5bc49bbf4bf9 Mon Sep 17 00:00:00 2001 From: Joss Moffatt Date: Sun, 22 Oct 2023 22:15:47 +0000 Subject: [PATCH 5/5] Generate coverage report with pytest --- .github/workflows/cicd.yaml | 2 +- requirements-dev.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index e669bd9..743b076 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -26,7 +26,7 @@ jobs: run: flake8 . - name: ๐Ÿงช Run unit tests - run: pytest # Replace with the command to run your tests + run: pytest --cov - name: โ˜‚๏ธ Upload coverage reports to Codecov uses: codecov/codecov-action@v3 diff --git a/requirements-dev.txt b/requirements-dev.txt index 5e96b72..3e411dd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,5 +2,6 @@ rich~=13.6.0 rich-click~=1.7.0 assertpy~=1.1.0 pytest==7.4.2 +pytest-cov==4.1.0 setuptools==68.2.2 flake8~=6.1.0 \ No newline at end of file