Skip to content

fix: None is valid env value (#9) #23

fix: None is valid env value (#9)

fix: None is valid env value (#9) #23

Workflow file for this run

name: CI
on:
push:
branches: [ "master" ]
paths-ignore:
- "docs/**"
- "*.md"
pull_request:
branches: [ "master" ]
paths-ignore:
- "docs/**"
- "*.md"
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 flake8-pyproject ruff black
- name: Lint with flake8
run: |
flake8 .
- name: Lint with ruff
run: |
ruff check .
- name: Check with black
run: |
black --check .
build-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install build twine
- name: Build package
run: |
python -m build
- name: Check package metadata
run: |
twine check dist/*
test:
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
include:
# ------------------------ PYTEST-HTML==4.0.2
- platform: "alpine"
python: "3.8.0"
pytest_html: "==4.0.2"
case_suffix: "py3_08_00-html_eq4_0_2"
- platform: "alpine"
python: "3.8"
pytest_html: "==4.0.2"
case_suffix: "py3_08_xx-html_eq4_0_2"
- platform: "alpine"
python: "3.9"
pytest_html: "==4.0.2"
case_suffix: "py3_09_xx-html_eq4_0_2"
- platform: "alpine"
python: "3.10"
pytest_html: "==4.0.2"
case_suffix: "py3_10_xx-html_eq4_0_2"
- platform: "alpine"
python: "3.11"
pytest_html: "==4.0.2"
case_suffix: "py3_11_xx-html_eq4_0_2"
- platform: "alpine"
python: "3.12"
pytest_html: "==4.0.2"
case_suffix: "py3_12_xx-html_eq4_0_2"
- platform: "alpine"
python: "3.13"
pytest_html: "==4.0.2"
case_suffix: "py3_13_xx-html_eq4_0_2"
- platform: "alpine"
python: "3.14"
pytest_html: "==4.0.2"
case_suffix: "py3_14_xx-html_eq4_0_2"
# ------------------------ PYTEST-HTML: DEFAULT
- platform: "alpine"
python: "3.8.0"
pytest_html: "default"
case_suffix: "py3_08_00-html_default"
- platform: "alpine"
python: "3.8"
pytest_html: "default"
case_suffix: "py3_08_xx-html_default"
- platform: "alpine"
python: "3.9"
pytest_html: "default"
case_suffix: "py3_09_xx-html_default"
- platform: "alpine"
python: "3.10"
pytest_html: "default"
case_suffix: "py3_10_xx-html_default"
- platform: "alpine"
python: "3.11"
pytest_html: "default"
case_suffix: "py3_11_xx-html_default"
- platform: "alpine"
python: "3.12"
pytest_html: "default"
case_suffix: "py3_12_xx-html_default"
- platform: "alpine"
python: "3.13"
pytest_html: "default"
case_suffix: "py3_13_xx-html_default"
- platform: "alpine"
python: "3.14"
pytest_html: "default"
case_suffix: "py3_14_xx-html_default"
name: "test: ${{ matrix.platform }} | ${{ matrix.case_suffix }}"
env:
BASE_SIGN: "${{ matrix.platform }}-${{ matrix.case_suffix }}"
steps:
- name: Prepare variables
run: |
echo "RUN_CFG__NOW=$(date +'%Y%m%d_%H%M%S')" >> $GITHUB_ENV
echo "RUN_CFG__LOGS_DIR=logs-${{ env.BASE_SIGN }}" >> $GITHUB_ENV
echo "RUN_CFG__DOCKER_IMAGE_NAME=tests-${{ env.BASE_SIGN }}" >> $GITHUB_ENV
echo "---------- [$GITHUB_ENV]"
cat $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v6
- name: Prepare logs folder on the host
run: mkdir -p "${{ env.RUN_CFG__LOGS_DIR }}"
- name: Adjust logs folder permission
run: chmod -R 777 "${{ env.RUN_CFG__LOGS_DIR }}"
- name: Build local image ${{ matrix.alpine }}
run: |
docker build \
--build-arg PYTHON_VERSION="${{ matrix.python }}" \
--build-arg PYTEST_HTML_SPEC="${{ matrix.pytest_html }}" \
-t "${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}" \
-f Dockerfile--${{ matrix.platform }}.tmpl \
.
- name: Run
run: |
docker run -t \
-v ${{ github.workspace }}/${{ env.RUN_CFG__LOGS_DIR }}:/home/test/merger/logs \
"${{ env.RUN_CFG__DOCKER_IMAGE_NAME }}"
- name: Upload Logs
uses: actions/upload-artifact@v7
if: always() # IT IS IMPORTANT!
with:
name: pytest_html_report_merger--test_logs--${{ env.RUN_CFG__NOW }}-${{ env.BASE_SIGN }}-id${{ github.run_id }}
path: "${{ env.RUN_CFG__LOGS_DIR }}/"