From bd537bf5e7d26d12f87577186a1256355d0318f6 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Sun, 3 Mar 2024 21:25:34 +0200 Subject: [PATCH] split actions --- .github/workflows/github_action.yml | 20 ++++++++++ .github/workflows/mac.yml | 26 +++++++++++++ .github/workflows/precommit.yml | 24 ++++++++++++ .../workflows/{validation.yml => ubuntu.yml} | 37 ++----------------- .github/workflows/win.yml | 26 +++++++++++++ README.md | 12 ++++-- 6 files changed, 107 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/github_action.yml create mode 100644 .github/workflows/mac.yml create mode 100644 .github/workflows/precommit.yml rename .github/workflows/{validation.yml => ubuntu.yml} (51%) create mode 100644 .github/workflows/win.yml diff --git a/.github/workflows/github_action.yml b/.github/workflows/github_action.yml new file mode 100644 index 0000000..0f3e764 --- /dev/null +++ b/.github/workflows/github_action.yml @@ -0,0 +1,20 @@ +name: Test GitHub Action + +on: + push: + branches: + - '*' + pull_request: + types: + - opened + - reopened + - synchronize + +jobs: + md-dead-link-check: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: AlexanderDokuchaev/md-dead-link-check@main + with: + config: pyproject.toml diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 0000000..91ef554 --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,26 @@ +name: Test MacOS + +on: + push: + branches: + - '*' + pull_request: + types: + - opened + - reopened + - synchronize + +jobs: + pytest: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install package + run: pip install .[dev] + - name: Pytest + run: pytest tests -rfs -vv + - name: + run: md-dead-link-check -v diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml new file mode 100644 index 0000000..5846578 --- /dev/null +++ b/.github/workflows/precommit.yml @@ -0,0 +1,24 @@ +name: Validation + +on: + push: + branches: + - '*' + pull_request: + types: + - opened + - reopened + - synchronize + +jobs: + pre-commit: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install pre-commit + run: pip install pre-commit==3.2.2 + - name: Run pre-commit + run: pre-commit run -a diff --git a/.github/workflows/validation.yml b/.github/workflows/ubuntu.yml similarity index 51% rename from .github/workflows/validation.yml rename to .github/workflows/ubuntu.yml index bdafa2d..f9e7003 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/ubuntu.yml @@ -1,4 +1,4 @@ -name: Validation +name: Test Ubuntu on: push: @@ -37,36 +37,5 @@ jobs: run: pip install .[dev] - name: Pytest run: pytest tests -rfs -vv - - pytest-win: - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - name: Install package - run: pip install .[dev] - - name: Pytest - run: pytest tests -rfs -vv - - pytest-mac: - runs-on: macos-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - name: Install package - run: pip install .[dev] - - name: Pytest - run: pytest tests -rfs -vv - - - md-dead-link-check: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - uses: AlexanderDokuchaev/md-dead-link-check@main - with: - config: pyproject.toml + - name: + run: md-dead-link-check -v diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml new file mode 100644 index 0000000..d02f2ce --- /dev/null +++ b/.github/workflows/win.yml @@ -0,0 +1,26 @@ +name: Test Windows + +on: + push: + branches: + - '*' + pull_request: + types: + - opened + - reopened + - synchronize + +jobs: + pytest: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install package + run: pip install .[dev] + - name: Pytest + run: pytest tests -rfs -vv + - name: + run: md-dead-link-check.exe -v diff --git a/README.md b/README.md index f7f19bc..58aca26 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,11 @@ enabling it to process thousands links in several seconds. ## Proxy -This tool leverages your system's existing HTTP and HTTPS proxy configuration. It achieves this by trusting the environment variables that your operating system utilizes to define proxy settings. This functionality is enabled by the `aiohttp.ClientSession(trust_env=True)` option. -For further technical details, you can refer to the [aiohttp documentation](https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support) +This tool leverages your system's existing HTTP and HTTPS proxy configuration. +It achieves this by trusting the environment variables that your operating system utilizes to define proxy settings. +This functionality is enabled by the `aiohttp.ClientSession(trust_env=True)` option. +For further technical details, you can refer to the +[aiohttp documentation](https://docs.aiohttp.org/en/v3.9.3/client_advanced.html#proxy-support). ## How to Use It @@ -73,10 +76,11 @@ To leverage a different file, invoke the `--config` option during execution. - timeout: Specifies the maximum time (in seconds) to wait for web link responses. Default: `10` seconds. - exclude_links: Accepts a list of links to exclude from checks. Default: `[]`. - exclude_files: Accepts a list of files to exclude from checks. Default: `[]`. -- check_web_links: Toggle web link checks on or off. Set to `false` to focus solely on file-based links. Default: `true`. +- check_web_links: Toggle web link checks on or off. Default: `true`. [!TIP] -Leverage wildcard patterns ([fnmatch](https://docs.python.org/3/library/fnmatch.html) syntax) for flexible exclusions in both `exclude_links` and `exclude_files` lists. +Leverage wildcard patterns ([fnmatch](https://docs.python.org/3/library/fnmatch.html) syntax) for flexible exclusions +in both `exclude_links` and `exclude_files` lists. ```toml [tool.md_dead_link_check]