Skip to content

Commit

Permalink
wip: test 1110, expect YES Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
boromir674 committed Nov 11, 2023
1 parent dfcdd86 commit 7ff591f
Showing 1 changed file with 68 additions and 68 deletions.
136 changes: 68 additions & 68 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ env:
# On/Off switches for the various CI/CD steps
# If false the step prevented from running
# If true the step is allowed to run (it still may be skipped on other runtime conditions)
RUN_UNIT_TESTS: "false"
RUN_UNIT_TESTS: "true"
RUN_LINT_CHECKS: "false"
PUBLISH_ON_PYPI: "false"
DRAW_DEPENDENCIES: "false"
Expand All @@ -50,7 +50,7 @@ env:

# Override policy-dependent decision-making and
# Accept any ALL (branch/build) to Publish to Dockerhub
ALWAYS_BUILD_N_PUBLSIH_DOCKER: "true"
ALWAYS_BUILD_N_PUBLSIH_DOCKER: "false"

# Docker Policy

Expand Down Expand Up @@ -253,10 +253,10 @@ jobs:
echo "SEMVER_PIP_FORMAT=$WHEEL_VERSION" >> $GITHUB_OUTPUT # to be used in other jobs
## TEST SUITE: By Default executes only unit-tests (ie no integration, or network-dependent tests)
- name: Run Unit Tests
run: tox -vv -s false
env:
PLATFORM: ${{ matrix.platform }}
# - name: Run Unit Tests
# run: tox -vv -s false
# env:
# PLATFORM: ${{ matrix.platform }}
# if sdist tests ran, then we expect file to ahve been created
# .tox/${DIST_DIR}/cookiecutter_python-${PKG_VERSION}.tar.gz

Expand All @@ -269,71 +269,71 @@ jobs:
# no compiled code
# .tox/${DIST_DIR}/cookiecutter_python-${PKG_VERSION}-py3-none-any.whl

- name: "Aggregate Code Coverage & make XML Reports"
id: produce_coverage_xml_file
env:
# just "destructure" (aka extract) needed values from the matrix, to use in step code
PLATFORM: ${{ matrix.platform }}
PY_VERSION: ${{ matrix.python-version }}
run: |
tox -e coverage --sitepackages -vv -s false
# - name: "Aggregate Code Coverage & make XML Reports"
# id: produce_coverage_xml_file
# env:
# # just "destructure" (aka extract) needed values from the matrix, to use in step code
# PLATFORM: ${{ matrix.platform }}
# PY_VERSION: ${{ matrix.python-version }}
# run: |
# tox -e coverage --sitepackages -vv -s false

RUNNER_COVERAGE_XML_FILE_PATH="coverage-${PLATFORM}-${PY_VERSION}.xml"
mv ./.tox/coverage.xml "${RUNNER_COVERAGE_XML_FILE_PATH}"
# leverages ./scripts/post-tests-run.sh which returns the path of the XML Aggregated Coverage DataXML Filecoverage report
# chmod +x ./scripts/post-tests-run.sh
# RUNNER_COVERAGE_XML_FILE_PATH=$(./scripts/post-tests-run.sh "${PLATFORM}-${PY_VERSION}")
echo "CI_COVERAGE_XML=$RUNNER_COVERAGE_XML_FILE_PATH" >> $GITHUB_OUTPUT
echo "CI_COVERAGE_XML_THIS=$RUNNER_COVERAGE_XML_FILE_PATH" >> $GITHUB_ENV
- name: "Upload Test Coverage as Artifacts"
uses: actions/upload-artifact@v3
with:
name: all_coverage_raw
path: ${{ env.CI_COVERAGE_XML_THIS }}
# steps.produce_coverage_xml_file.outputs.retval
# path: coverage-${{ matrix.platform }}-${{ matrix.python-version }}.xml
if-no-files-found: error

- name: Check for compliance with Python Best Practices
shell: bash
run: |
DIST_DIR=dist
echo "DIST_DIR=dist" >> $GITHUB_ENV # can be uesd in a with body of a next step in the Job, as eg: path: ${{ env.DIST_DIR }}
mkdir ${DIST_DIR}
# RUNNER_COVERAGE_XML_FILE_PATH="coverage-${PLATFORM}-${PY_VERSION}.xml"

# mv ./.tox/coverage.xml "${RUNNER_COVERAGE_XML_FILE_PATH}"

# # leverages ./scripts/post-tests-run.sh which returns the path of the XML Aggregated Coverage DataXML Filecoverage report
# # chmod +x ./scripts/post-tests-run.sh
# # RUNNER_COVERAGE_XML_FILE_PATH=$(./scripts/post-tests-run.sh "${PLATFORM}-${PY_VERSION}")

# echo "CI_COVERAGE_XML=$RUNNER_COVERAGE_XML_FILE_PATH" >> $GITHUB_OUTPUT
# echo "CI_COVERAGE_XML_THIS=$RUNNER_COVERAGE_XML_FILE_PATH" >> $GITHUB_ENV

# - name: "Upload Test Coverage as Artifacts"
# uses: actions/upload-artifact@v3
# with:
# name: all_coverage_raw
# path: ${{ env.CI_COVERAGE_XML_THIS }}
# # steps.produce_coverage_xml_file.outputs.retval
# # path: coverage-${{ matrix.platform }}-${{ matrix.python-version }}.xml
# if-no-files-found: error

# - name: Check for compliance with Python Best Practices
# shell: bash
# run: |
# DIST_DIR=dist
# echo "DIST_DIR=dist" >> $GITHUB_ENV # can be uesd in a with body of a next step in the Job, as eg: path: ${{ env.DIST_DIR }}
# mkdir ${DIST_DIR}

TOXENV_DIST_DIR=".tox/${DIST_DIR}"
# TOXENV_DIST_DIR=".tox/${DIST_DIR}"

# Sanity check of files inside
echo "[DEBUG] ls -la ${TOXENV_DIST_DIR}"
ls -la ${TOXENV_DIST_DIR}
# # Sanity check of files inside
# echo "[DEBUG] ls -la ${TOXENV_DIST_DIR}"
# ls -la ${TOXENV_DIST_DIR}

# Sanity check that among all files there onle one tar.gz and one .whl
# if not, Fail Job (aka exit with 1)
# # Sanity check that among all files there onle one tar.gz and one .whl
# # if not, Fail Job (aka exit with 1)

# if [[ $(find ${TOXENV_DIST_DIR} -type f -name "*.tar.gz" | wc -l) -ne 1 ]]; then
# echo "ERROR: Expected to find 1 tar.gz file in ${TOXENV_DIST_DIR}, but found $(find ${TOXENV_DIST_DIR} -type f -name "*.tar.gz" | wc -l)"
# exit 1
# fi
# if [[ $(find ${TOXENV_DIST_DIR} -type f -name "*.whl" | wc -l) -ne 1 ]]; then
# echo "ERROR: Expected to find 1 .whl file in ${TOXENV_DIST_DIR}, but found $(find ${TOXENV_DIST_DIR} -type f -name "*.whl" | wc -l)"
# exit 1
# fi
# # if [[ $(find ${TOXENV_DIST_DIR} -type f -name "*.tar.gz" | wc -l) -ne 1 ]]; then
# # echo "ERROR: Expected to find 1 tar.gz file in ${TOXENV_DIST_DIR}, but found $(find ${TOXENV_DIST_DIR} -type f -name "*.tar.gz" | wc -l)"
# # exit 1
# # fi
# # if [[ $(find ${TOXENV_DIST_DIR} -type f -name "*.whl" | wc -l) -ne 1 ]]; then
# # echo "ERROR: Expected to find 1 .whl file in ${TOXENV_DIST_DIR}, but found $(find ${TOXENV_DIST_DIR} -type f -name "*.whl" | wc -l)"
# # exit 1
# # fi

# REQUIRED existing 'Source Distribution' (SD) aka .tar.gz file, has already been built from source code
# ie previous code/step ran a tox env, such as with cmd `tox -e py38-sdist-linux`, or any `sdist` tox env,
# which runs Unit Tests against the .tar.gz (sdist installation), after building it from source code,
# # REQUIRED existing 'Source Distribution' (SD) aka .tar.gz file, has already been built from source code
# # ie previous code/step ran a tox env, such as with cmd `tox -e py38-sdist-linux`, or any `sdist` tox env,
# # which runs Unit Tests against the .tar.gz (sdist installation), after building it from source code,

# move .tar.gz
mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}.tar.gz" "${DIST_DIR}"
# # move .tar.gz
# mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}.tar.gz" "${DIST_DIR}"

# move .whl
# mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}-py3-none-any.whl" "${DIST_DIR}"
# # move .whl
# # mv ".tox/${DIST_DIR}/artificial_artwork-${PKG_VERSION}-py3-none-any.whl" "${DIST_DIR}"

# tox -e check -vv -s false
# # tox -e check -vv -s false

# - name: Install documentation test dependencies
# if: ${{ matrix.platform == 'macos-latest' && matrix.python-version != '3.6' }}
Expand All @@ -342,12 +342,12 @@ jobs:
# if: ${{ matrix.platform == 'ubuntu-latest' || matrix.python-version != '3.6' }}
# run: tox -e docs --sitepackages -vv -s false

- name: Upload Source & Wheel distributions as Artefacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.DIST_DIR }}-${{ matrix.platform }}-${{ matrix.python-version }}
path: ${{ env.DIST_DIR }}
if-no-files-found: error
# - name: Upload Source & Wheel distributions as Artefacts
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.DIST_DIR }}-${{ matrix.platform }}-${{ matrix.python-version }}
# path: ${{ env.DIST_DIR }}
# if-no-files-found: error


### JOB: UPLOAD COVERAGE REPORTS TO CODECOV ###
Expand Down

0 comments on commit 7ff591f

Please sign in to comment.