fix: input file is opened with "utf-8" encoding (#15) #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| needs: lint | |
| 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/* | |
| - name: Test installation and entry point | |
| run: | | |
| # 1. Install exactly what you just compiled (the wheel file) | |
| python -m pip install dist/*.whl | |
| # 2. Check that the command is available in the PATH and displays help | |
| # If entry_points is set incorrectly, everything will fail here. | |
| pgpro-pytest-html-merger --help | |
| # 3. Checking the version | |
| pgpro-pytest-html-merger --version | |
| test: | |
| runs-on: ubuntu-latest | |
| needs: build-check | |
| 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==4.1.0 | |
| - platform: "alpine" | |
| python: "3.8.0" | |
| pytest_html: "==4.1.0" | |
| case_suffix: "py3_08_00-html_eq4_1_0" | |
| - platform: "alpine" | |
| python: "3.8" | |
| pytest_html: "==4.1.0" | |
| case_suffix: "py3_08_xx-html_eq4_1_0" | |
| - platform: "alpine" | |
| python: "3.9" | |
| pytest_html: "==4.1.0" | |
| case_suffix: "py3_09_xx-html_eq4_1_0" | |
| - platform: "alpine" | |
| python: "3.10" | |
| pytest_html: "==4.1.0" | |
| case_suffix: "py3_10_xx-html_eq4_1_0" | |
| - platform: "alpine" | |
| python: "3.11" | |
| pytest_html: "==4.1.0" | |
| case_suffix: "py3_11_xx-html_eq4_1_0" | |
| - platform: "alpine" | |
| python: "3.12" | |
| pytest_html: "==4.1.0" | |
| case_suffix: "py3_12_xx-html_eq4_1_0" | |
| - platform: "alpine" | |
| python: "3.13" | |
| pytest_html: "==4.1.0" | |
| case_suffix: "py3_13_xx-html_eq4_1_0" | |
| - platform: "alpine" | |
| python: "3.14" | |
| pytest_html: "==4.1.0" | |
| case_suffix: "py3_14_xx-html_eq4_1_0" | |
| # ------------------------ 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 }}/" |