diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 49ba756c012241cf4759ce70f3f1b3c24d6ec8e5..10c6624f4103ccac5b750664ed1cdb4bcee07646 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,21 +1,20 @@ stages: + - pre-build - build - - test - build-review - review - - quality-security - - cleanup + - test - release - deploy variables: - URL: "example.com" # if you include 'website-deploy' - INDEX: "index.html" - DIST: "website" + DIST: "website" # change if you use custom build script REPO: "templates/simple-webpage" - AUTHPASSWORD: "example" # change to "" (empty string) to disable authentication + AUTHPASSWORD: "" # change to "" (empty string) to disable authentication # username is always "review" (without quotes) - CI_REF: &ref 2048650e2b7bd1ac2e54fc930be9a476682dbd57 + DOCKER_TLS_CERTDIR: "" + + CI_REF: &ref 439cec9548425401680cbc2b56b1e79525bd64d4 include: # BEFORE SCRIPT @@ -28,15 +27,6 @@ include: file: "empty-build.yml" ref: *ref - # TEST - - project: "templates/ci-snippets" - file: "simple-website/tidy.yml" - ref: *ref - - - project: "templates/ci-snippets" - file: "simple-website/blc.yml" - ref: *ref - # BUILD-REVIEW - project: "templates/ci-snippets" file: "simple-website/review/build-review.yml" @@ -51,27 +41,14 @@ include: file: "simple-website/review/stop-review.yml" ref: *ref - # CODE QUALITY - # - project: 'templates/ci-snippets' - # file: 'quality-security/code-quality.yml' - - # - project: 'templates/ci-snippets' - # file: 'quality-security/sast.yml' - - # - project: 'templates/ci-snippets' - # file: 'quality-security/deps-scan.yml' - - # - project: 'templates/ci-snippets' - # file: 'quality-security/container-scan.yml' - - # - project: 'templates/ci-snippets' - # file: 'quality-security/dast.yml' - - # - project: 'templates/ci-snippets' - # file: 'quality-security/license-check.yml' + # TEST + - project: "templates/ci-snippets" + file: "simple-website/blc.yml" + ref: *ref - # - project: 'templates/ci-snippets' - # file: 'quality-security/performance.yml' + - project: "templates/ci-snippets" + file: "simple-website/tidy.yml" + ref: *ref # RELEASE - project: "templates/ci-snippets" @@ -86,3 +63,61 @@ include: - project: "templates/ci-snippets" file: "trigger-websites-deploy.yml" ref: *ref + + - template: Verify/Browser-Performance.gitlab-ci.yml + + - template: DAST.gitlab-ci.yml + +performance: + stage: test + variables: + GIT_STRATEGY: none + SITESPEED_OPTIONS: -n 1 -d 2 --visualMetrics false --video false + URL: https://$CI_BUILD_REF_NAME-$CI_PROJECT_NAME.review.dbogatov.org/ + except: + - pipelines + - triggers + when: manual + tags: + - docker + +dast: + stage: test + variables: + DAST_WEBSITE: https://$CI_BUILD_REF_NAME-$CI_PROJECT_NAME.review.dbogatov.org + DAST_FULL_SCAN_ENABLED: "true" + except: + - pipelines + - triggers + when: manual + tags: + - docker + +# https://gitlab.com/gitlab-org/gitlab/-/raw/master/lib/gitlab/ci/templates/Verify/Accessibility.gitlab-ci.yml +accessibility: + stage: test + image: node + variables: + GIT_STRATEGY: none + a11y_urls: https://$CI_BUILD_REF_NAME-$CI_PROJECT_NAME.review.dbogatov.org + script: + - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ + - echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \ + - apt-get update && \ + - apt-get install -y google-chrome-stable && \ + - rm -rf /var/lib/apt/lists/* + - npm install pa11y@5.3.0 pa11y-reporter-html@1.0.0 + - 'echo { \"chromeLaunchConfig\": { \"args\": [\"--no-sandbox\"] }, \"includeWarnings\": true, \"reporter\": \"html\" } > pa11y.json' + - "./node_modules/.bin/pa11y $a11y_urls > accessibility.html || true" + - test -f accessibility.html + allow_failure: true + artifacts: + when: always + expose_as: "accessibility" + paths: ["accessibility.html"] + except: + - pipelines + - triggers + when: manual + tags: + - docker