Skip to content

Commit

Permalink
CI: Move offline links checker to daily scheduled workflow (#3801)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmuloc authored Apr 3, 2024
1 parent 8dd875a commit 16bef4c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 38 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/offline-links-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: "Check links offline for dead targets"

on:
# schedule every day at 3 AM on devel
schedule:
- cron: "0 3 * * *"
# Allow for manual trigger on the selected branch in UI
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
offline_link_check:
name: 'Validate mkdoc content'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: 'Start docker-compose stack'
run: |
docker-compose -f development/docker-compose.yml up -d webdoc_avd
docker-compose -f development/docker-compose.yml ps
- name: 'Test connectivity to mkdoc server'
run: |
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' 127.0.0.1:8000)" != "200" ]]; do sleep 5; done'
- name: Check links for 404
run: |
docker run --network container:webdoc_avd raviqqe/muffet:2.10.1 http://127.0.0.1:8000/ -f \
--buffer-size 8192 \
--exclude ".*fonts.googleapis.com.*" \
--exclude ".*fonts.gstatic.com.*" \
--exclude ".*tools.ietf.org.*" \
--exclude ".*edit.*" \
--exclude ".*docs.github.com.*" \
--exclude "twitter.com" \
--exclude "www.docker.com" \
--exclude "hub.docker.com" \
--exclude "tech-library.arista.com" \
--max-connections-per-host 30 \
--max-redirections 3 \
--rate-limit 1 \
--timeout 30
- name: 'Stop docker-compose stack'
run: |
docker-compose -f development/docker-compose.yml down
38 changes: 0 additions & 38 deletions .github/workflows/pull-request-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,44 +93,6 @@ jobs:
# Do NOT set a name for the pre-commit-ci action. Otherwise the Github App will not pick it up.
- uses: pre-commit-ci/[email protected]
if: always()
# ----------------------------------- #
# Check Links offline for dead target
# ----------------------------------- #
offline_link_check:
name: 'Validate mkdoc content'
runs-on: ubuntu-latest
needs: [ file-changes ]
if: needs.file-changes.outputs.docs == 'true'
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: 'Start docker-compose stack'
run: |
docker-compose -f development/docker-compose.yml up -d webdoc_avd
docker-compose -f development/docker-compose.yml ps
- name: 'Test connectivity to mkdoc server'
run: |
bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' 127.0.0.1:8000)" != "200" ]]; do sleep 5; done'
- name: Check links for 404
run: |
docker run --network container:webdoc_avd raviqqe/muffet:2.10.1 http://127.0.0.1:8000/ -f \
--buffer-size 8192 \
--exclude ".*fonts.googleapis.com.*" \
--exclude ".*fonts.gstatic.com.*" \
--exclude ".*tools.ietf.org.*" \
--exclude ".*edit.*" \
--exclude ".*docs.github.com.*" \
--exclude "twitter.com" \
--exclude "www.docker.com" \
--exclude "hub.docker.com" \
--exclude "tech-library.arista.com" \
--max-connections-per-host 30 \
--max-redirections 3 \
--rate-limit 1 \
--timeout 30
- name: 'Stop docker-compose stack'
run: |
docker-compose -f development/docker-compose.yml down

# ----------------------------------- #
# Test Requirements
Expand Down

0 comments on commit 16bef4c

Please sign in to comment.