diff --git a/.github/workflows/amp.yml b/.github/workflows/amp.yml deleted file mode 100644 index 29c1ed77b3a..00000000000 --- a/.github/workflows/amp.yml +++ /dev/null @@ -1,26 +0,0 @@ -on: - workflow_call: - inputs: - container-image: - description: 'Image used by DCR service' - required: true - type: string - -jobs: - validate: - runs-on: ubuntu-latest - services: - DCR: - image: ${{ inputs.container-image }} - ports: - - 9000:9000 - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Node environment - uses: ./.github/actions/setup-node-env - - - name: Validate AMP - run: make ampValidation - working-directory: dotcom-rendering diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 8a694e3a2de..ce4121b6979 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -26,12 +26,6 @@ jobs: with: container-image: ${{ needs.container.outputs.container-image }} - amp: - needs: [container] - uses: ./.github/workflows/amp.yml - with: - container-image: ${{ needs.container.outputs.container-image }} - publish: permissions: id-token: write diff --git a/dotcom-rendering/makefile b/dotcom-rendering/makefile index 1deab440511..c33d4623ff7 100644 --- a/dotcom-rendering/makefile +++ b/dotcom-rendering/makefile @@ -82,10 +82,6 @@ playwright-open: clear clean-dist install build $(call log, "starting DEV server and opening Playwright UI") @pnpm playwright:open -ampValidation: clean-dist install - $(call log, "starting AMP Validation test") - @node scripts/test/amp-validation.js - buildCheck: $(call log, "checking build files") @node ./scripts/test/build-check.js diff --git a/dotcom-rendering/scripts/test/amp-validation.js b/dotcom-rendering/scripts/test/amp-validation.js deleted file mode 100644 index 234c51f838d..00000000000 --- a/dotcom-rendering/scripts/test/amp-validation.js +++ /dev/null @@ -1,58 +0,0 @@ -/* eslint-disable */ -const amphtmlValidator = require('amphtml-validator'); -const http = require('http'); - -const domain = 'http://localhost:9000'; - -console.log(`Testing AMP validation on ${domain}`); -amphtmlValidator.getInstance().then((validator) => { - [ - 'tv-and-radio/2021/feb/03/deutschland-89-stasi-horror-spy-trilogy', - 'environment/commentisfree/2021/feb/03/the-african-painted-dogs-that-vote-by-sneezing-and-run-on-shadow-puppet-legs', - 'commentisfree/2021/feb/02/alexei-navalny-jailed-vladimir-putin-opposition-russians-kremlin', - 'sport/2021/feb/03/worlds-top-six-women-all-grace-melbourne-park-on-same-day-as-ash-barty-wins-thriller', - 'football/2021/feb/02/manchester-united-southampton-premier-league-match-report', - 'football/2021/feb/02/wolves-arsenal-premier-league-match-report', - 'global-development/2021/feb/02/myanmar-coup-military-tightens-grip-amid-calls-for-suu-kyi-to-be-freed', - 'world/2021/feb/03/academic-jailed-in-iran-pulls-off-daring-escape-back-to-britain-kameel-ahmady', - 'global-development/2021/feb/03/decades-of-progress-on-extreme-poverty-now-in-reverse-due-to-covid', - 'world/2021/feb/02/vienna-man-body-apartment-two-months-forgotten', - 'world/2021/feb/02/italian-president-sergio-mattarella-to-seek-a-high-profile-government', - 'environment/2021/feb/02/beekeeper-stung-by-post-brexit-ban-and-threat-to-burn-15m-bees', - 'environment/2021/feb/02/sea-level-rise-could-be-worse-than-feared-warn-researchers', - 'uk-news/2021/feb/02/captain-sir-tom-moore-dies-at-100-after-testing-positive-for-covid', - 'food/2021/feb/02/the-real-thing-my-battle-to-beat-a-27-year-diet-coke-addiction', - 'money/2020/may/08/homebuyers-plotting-move-to-country-amid-increased-home-working', - ].map((url) => { - // COPIED DIRECTLY FROM https://www.npmjs.com/package/amphtml-validator - http.get( - `${domain}/AMPArticle/https://amp.theguardian.com/${url}`, - (res) => { - let data = ''; - res.on('data', function (chunk) { - data += chunk; - }); - res.on('end', function () { - const result = validator.validateString(data); - console.log(url); - if (result.status === 'PASS') { - console.log('PASS'); - } else { - console.error('FAIL'); - for (let ii = 0; ii < result.errors.length; ii++) { - const error = result.errors[ii]; - let msg = `line ${error.line}, col ${error.col}: ${error.message}`; - if (error.specUrl !== null) { - msg += ` (see ${error.specUrl})`; - } - (error.severity === 'ERROR' - ? console.error - : console.warn)(msg); - } - throw new Error('Failed AMP Validation'); - } - }); - }, - ); - }); -});