From 0c09c1cddfd9d31ad71000de5d46e5f4925ba0d4 Mon Sep 17 00:00:00 2001 From: Ricardo de Matos Date: Wed, 14 Sep 2022 22:41:10 +0100 Subject: [PATCH] Continuous Integration workflow reviewed --- .coveragerc | 20 ++++++++++++ .github/workflows/continuous_integration.yml | 32 +++++++++++--------- pytest.ini | 13 ++++++++ 3 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 .coveragerc create mode 100644 pytest.ini diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..94ee40f --- /dev/null +++ b/.coveragerc @@ -0,0 +1,20 @@ +[run] +omit = + */commands/* + */factories/* + */migrations/* + */settings/* + */tests/* + *__init__.py + *admin.py + *quantities.py + *renderers.py + *storage.py + *tests.py + *wsgi.py + +[report] +sort = -cover + +[html] +directory = coverage diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index de1c058..0a420ed 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -7,7 +7,7 @@ concurrency: on: schedule: - - cron: '30 1,13 * * 1-5' # At minute 30 past hour 1 and 13 on every day-of-week from Monday through Friday + - cron: '30 1 * * 1-5' # At minute 30 past hour 1 on every day-of-week from Monday through Friday jobs: @@ -27,15 +27,16 @@ jobs: run: | echo "::set-output name=repository::$( echo "${{ github.repository }}" )" echo "::set-output name=repository_owner::$( echo "${{ github.repository_owner }}" )" - echo "::set-output name=repository_name::$( echo "${{ github.event.repository.name }}" )" - echo "::set-output name=branch::$( echo "${{ github.event.repository.default_branch }}" )" + echo "::set-output name=repository_name::$( echo "${{ github.repository }}" | sed --regexp-extended --expression 's|${{ github.repository_owner }}\/||g' )" + echo "::set-output name=branch_name::$( echo "${{ github.ref_name }}" )" + echo "::set-output name=branch_ref::$( echo "${{ github.ref }}" )" shell: bash - name: 'Check out repository' id: checkout uses: actions/checkout@v3 with: - ref: '${{ steps.setup.outputs.branch }}' + ref: '${{ steps.setup.outputs.branch_ref }}' - name: 'Set up python' id: python @@ -102,15 +103,16 @@ jobs: run: | echo "::set-output name=repository::$( echo "${{ github.repository }}" )" echo "::set-output name=repository_owner::$( echo "${{ github.repository_owner }}" )" - echo "::set-output name=repository_name::$( echo "${{ github.event.repository.name }}" )" - echo "::set-output name=branch::$( echo "${{ github.event.repository.default_branch }}" )" + echo "::set-output name=repository_name::$( echo "${{ github.repository }}" | sed --regexp-extended --expression 's|${{ github.repository_owner }}\/||g' )" + echo "::set-output name=branch_name::$( echo "${{ github.ref_name }}" )" + echo "::set-output name=branch_ref::$( echo "${{ github.ref }}" )" shell: bash - name: 'Check out repository' id: checkout uses: actions/checkout@v3 with: - ref: '${{ steps.setup.outputs.branch }}' + ref: '${{ steps.setup.outputs.branch_ref }}' - name: 'Set up python' id: python @@ -136,15 +138,16 @@ jobs: run: | echo "::set-output name=repository::$( echo "${{ github.repository }}" )" echo "::set-output name=repository_owner::$( echo "${{ github.repository_owner }}" )" - echo "::set-output name=repository_name::$( echo "${{ github.event.repository.name }}" )" - echo "::set-output name=branch::$( echo "${{ github.event.repository.default_branch }}" )" + echo "::set-output name=repository_name::$( echo "${{ github.repository }}" | sed --regexp-extended --expression 's|${{ github.repository_owner }}\/||g' )" + echo "::set-output name=branch_name::$( echo "${{ github.ref_name }}" )" + echo "::set-output name=branch_ref::$( echo "${{ github.ref }}" )" shell: bash - name: 'Check out repository' id: checkout uses: actions/checkout@v3 with: - ref: '${{ steps.setup.outputs.branch }}' + ref: '${{ steps.setup.outputs.branch_ref }}' - name: 'Get build version' id: versioning @@ -181,8 +184,9 @@ jobs: run: | echo "::set-output name=repository::$( echo "${{ github.repository }}" )" echo "::set-output name=repository_owner::$( echo "${{ github.repository_owner }}" )" - echo "::set-output name=repository_name::$( echo "${{ github.event.repository.name }}" )" - echo "::set-output name=branch::$( echo "${{ github.event.repository.default_branch }}" )" + echo "::set-output name=repository_name::$( echo "${{ github.repository }}" | sed --regexp-extended --expression 's|${{ github.repository_owner }}\/||g' )" + echo "::set-output name=branch_name::$( echo "${{ github.ref_name }}" )" + echo "::set-output name=branch_ref::$( echo "${{ github.ref }}" )" echo "::set-output name=channel::$( echo "#development" )" shell: bash @@ -190,7 +194,7 @@ jobs: id: checkout uses: actions/checkout@v3 with: - ref: '${{ steps.setup.outputs.branch }}' + ref: '${{ steps.setup.outputs.branch_ref }}' - name: 'Get build version' id: versioning @@ -217,5 +221,5 @@ jobs: fields: | [ { "title": "Version", "value": "${{ steps.versioning.outputs.version }}", "short": true } - ,{ "title": "Branch", "value": "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ steps.setup.outputs.branch }}>", "short": true } + ,{ "title": "Branch", "value": "<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ steps.setup.outputs.branch_name }}>", "short": true } ] diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..8f88e8c --- /dev/null +++ b/pytest.ini @@ -0,0 +1,13 @@ +[pytest] +minversion = 3.9 +DJANGO_SETTINGS_MODULE = +testpaths = +norecursedirs = + __pycache__ + migrations +python_files = + test_*.py + tests.py +addopts = -v -p no:warnings + --ignore=src + --durations=0