diff --git a/.github/actions/base-setup/action.yml b/.github/actions/base-setup/action.yml index 143ed0e..a4193d8 100644 --- a/.github/actions/base-setup/action.yml +++ b/.github/actions/base-setup/action.yml @@ -40,7 +40,7 @@ runs: echo "DEPENDENCY_TYPE=$DEPENDENCY_TYPE" >> $GITHUB_ENV - name: Install Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true @@ -54,7 +54,7 @@ runs: run: | echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.pip-cache.outputs.dir }} key: ${{ env.CACHE_PREFIX }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('setup.cfg', 'setup.py', '**/requirements.txt') }} @@ -62,7 +62,7 @@ runs: ${{ env.CACHE_PREFIX }}-pip-${{ env.PYTHON_VERSION }} - name: Install node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} @@ -77,7 +77,7 @@ runs: [[ "$CACHE_DIR" == "undefined" ]] && CACHE_DIR=$(yarn cache dir) echo "dir=$CACHE_DIR" >> $GITHUB_OUTPUT - name: Cache yarn - uses: actions/cache@v3 + uses: actions/cache@v4 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} @@ -87,7 +87,7 @@ runs: - name: Cache checked links if: ${{ matrix.group == 'link_check' }} - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pytest-link-check key: ${{ env.CACHE_PREFIX }}-linkcheck-${{ hashFiles('**/*.md', '**/*.rst') }}-links @@ -95,7 +95,7 @@ runs: ${{ env.CACHE_PREFIX }}-linkcheck- - name: Cache conda - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/conda_pkgs_dir key: ${{ env.CACHE_PREFIX }}-conda-${{ env.CACHE_NUMBER }}-${{ diff --git a/.github/actions/make-sdist/action.yml b/.github/actions/make-sdist/action.yml index 3a00ea1..8b44db0 100644 --- a/.github/actions/make-sdist/action.yml +++ b/.github/actions/make-sdist/action.yml @@ -7,7 +7,7 @@ runs: run: | pip install build python -m build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: "sdist" path: dist/*.tar.gz diff --git a/.github/actions/report-coverage/action.yml b/.github/actions/report-coverage/action.yml index ed0b5b8..c1f3294 100644 --- a/.github/actions/report-coverage/action.yml +++ b/.github/actions/report-coverage/action.yml @@ -4,21 +4,28 @@ inputs: fail_under: description: "The coverage amount to fail under" default: 80 + artifact_pattern: + description: "" + required: false + default: coverage-data* runs: using: "composite" steps: - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: # Use latest Python, so it understands all syntax. - python-version: "3.11" + python-version: "3.12" - run: python -Im pip install --upgrade coverage[toml] shell: bash - - uses: actions/download-artifact@v3 + - name: Merge Artifacts + uses: actions/upload-artifact/merge@v4 with: name: coverage-data + pattern: ${{ inputs.artifact_pattern }} + delete-merged: true - name: Combine coverage & fail if it's <${{inputs.fail_under}}. shell: bash @@ -34,7 +41,7 @@ runs: python -Iim coverage report --fail-under=${{inputs.fail_under}} - name: Upload HTML report if check failed. - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: html-report path: htmlcov diff --git a/.github/actions/test-sdist/action.yml b/.github/actions/test-sdist/action.yml index bc7b130..acdb88e 100644 --- a/.github/actions/test-sdist/action.yml +++ b/.github/actions/test-sdist/action.yml @@ -17,7 +17,7 @@ runs: using: "composite" steps: - name: Download sdist - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Install From SDist shell: bash run: | diff --git a/.github/actions/update-snapshots/action.yml b/.github/actions/update-snapshots/action.yml index 3ae1762..65ce2a9 100644 --- a/.github/actions/update-snapshots/action.yml +++ b/.github/actions/update-snapshots/action.yml @@ -74,6 +74,8 @@ runs: working-directory: ${{ inputs.test_folder }} run: | ${{ inputs.npm_client }} install + # Force installing the dependencies + npx playwright install-deps || true ${{ inputs.npm_client }} run playwright install ${{ inputs.chromium }} - name: Wait for the server @@ -103,13 +105,13 @@ runs: echo "::endgroup::" - name: Upload snapshots as artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ inputs.artifact_name }} path: ${{ inputs.test_folder }}/**/*-snapshots/*.* - name: Upload report as artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ inputs.report_name }} path: ${{ inputs.test_folder }}/playwright-report diff --git a/.github/actions/upload-coverage/action.yml b/.github/actions/upload-coverage/action.yml index aa9f915..70d86ed 100644 --- a/.github/actions/upload-coverage/action.yml +++ b/.github/actions/upload-coverage/action.yml @@ -1,6 +1,13 @@ name: "Upload Coverage" description: "Upload the coverage report(s) for this job" +inputs: + # Optional inputs + artifact_name: + description: The artifact name - useful if multiple artifacts are created + required: false + default: coverage-data + runs: using: "composite" steps: @@ -11,8 +18,8 @@ runs: mv .coverage ".coverage.-$$-$RANDOM" fi - name: Upload coverage data - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: coverage-data + name: ${{ inputs.artifact_name }} path: ".coverage.*" if-no-files-found: ignore diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 124c9f9..2e14051 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,7 +25,7 @@ jobs: - name: Base Setup uses: ./.github/actions/base-setup with: - node_version: 15.0 + node_version: 18.0 - name: Check Hatch Version run: hatch --version @@ -189,6 +189,7 @@ jobs: test_folder: ${{ env.TEST_FOLDER }} server_url: https-get://playwright.dev dry_run: yes + artifact_name: playwright-manual-snapshots update_snapshots: runs-on: ubuntu-latest @@ -265,6 +266,8 @@ jobs: python -m coverage run -m pytest foobar.py ls -a - uses: ./.github/actions/upload-coverage + with: + artifact_name: coverage-data-${{ matrix.os }} coverage_report: name: Combine & check coverage diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 333c437..89e2a90 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,6 +35,8 @@ repos: hooks: - id: prettier types_or: [yaml, html, json] + # Ignore package.json because its indentation is switched to 4 when upgrading the version + exclude: ^package.json$ - repo: https://github.com/adamchainz/blacken-docs rev: "1.16.0"