diff --git a/.github/workflows/generate_chapters.yml b/.github/workflows/generate_chapters.yml index 759bd9cec10..ff7d2613d24 100644 --- a/.github/workflows/generate_chapters.yml +++ b/.github/workflows/generate_chapters.yml @@ -43,7 +43,7 @@ jobs: - name: Setup Node.js for use with actions uses: actions/setup-node@v1.4.2 with: - version: 12.x + node-version: 12.x - name: Set up Python 3.7 uses: actions/setup-python@v2.1.2 with: diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index b246acb86c4..33448492103 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -33,7 +33,7 @@ jobs: run: | echo "::set-env name=VALIDATE_ALL_CODEBASE::false" - name: Lint Code Base - uses: docker://github/super-linter:v3 + uses: github/super-linter@v3.7.0 env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test_website.yml b/.github/workflows/test_website.yml index 40911d18973..a00d6cae250 100644 --- a/.github/workflows/test_website.yml +++ b/.github/workflows/test_website.yml @@ -20,10 +20,16 @@ jobs: - name: Setup Node.js for use with actions uses: actions/setup-node@v1.4.2 with: - version: 12.x + node-version: 12.x - name: Set up Python 3.7 uses: actions/setup-python@v2.1.2 with: python-version: '3.7' - name: Run the website run: ./src/tools/scripts/run_and_test_website.sh + - name: Lint Generated HTML + uses: github/super-linter@v3.7.0 + env: + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_HTML: true diff --git a/src/.gitignore b/src/.gitignore index 05f2fc14f87..19ecec6e6af 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -1,3 +1,4 @@ .idea/ .vscode/ -node_modules/ \ No newline at end of file +node_modules/ +static/html/ diff --git a/src/tools/test/test_status_codes.js b/src/tools/test/test_status_codes.js index 7182fc3eeae..50f416568f6 100644 --- a/src/tools/test/test_status_codes.js +++ b/src/tools/test/test_status_codes.js @@ -8,6 +8,8 @@ const default_year = 2019; const default_language = 'en'; const base_url = "http://127.0.0.1:8080"; +const output_dir = `static/html`; + let failures = 0; let passes = 0; @@ -44,6 +46,12 @@ const test_status_code = async (page, status, location) => { if (response.status === status && response.headers.get('location') === location) { console.log('Success - expected:', status, 'got:',response.status, 'for page:', page); passes++; + if (status === 200 && response.headers.get('content-type').startsWith('text/html')) { + if (page.slice(-1) === '/') page = page + 'index'; + page = page + '.html'; + const body = await response.text(); + await fs.outputFile(output_dir + page, body, 'utf8'); + } } else { console.error('Failed - expected:', status, 'got:',response.status, 'for page:', page, 'location:', location); failures++;