Commit 7755b947 authored by Beatriz Rizental's avatar Beatriz Rizental
Browse files

fixup! Add CI for Base Browser

parent cab55870
Loading
Loading
Loading
Loading
+2 −273
Original line number Diff line number Diff line
.base:
lint-all:
  extends: .with-local-repo-bash
  stage: lint
  image: $IMAGE_PATH
@@ -16,281 +16,10 @@
  tags:
    # Run these jobs in the browser dedicated runners.
    - firefox

eslint:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l eslint
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        # Files that are likely audited.
        - '**/*.js'
        - '**/*.jsm'
        - '**/*.json'
        - '**/*.jsx'
        - '**/*.mjs'
        - '**/*.sjs'
        - '**/*.html'
        - '**/*.xhtml'
        - '**/*.xml'
        - 'tools/lint/eslint.yml'
        # Run when eslint policies change.
        - '**/.eslintignore'
        - '**/*eslintrc*'
        # The plugin implementing custom checks.
        - 'tools/lint/eslint/eslint-plugin-mozilla/**'
        - 'tools/lint/eslint/eslint-plugin-spidermonkey-js/**'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

stylelint:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l stylelint
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        # Files that are likely audited.
        - '**/*.css'
        - 'tools/lint/styleint.yml'
        # Run when stylelint policies change.
        - '**/.stylelintignore'
        - '**/*stylelintrc*'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

py-black:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l black
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        # The list of extensions should match tools/lint/black.yml
        - '**/*.py'
        - '**/moz.build'
        - '**/*.configure'
        - '**/*.mozbuild'
        - 'pyproject.toml'
        - 'tools/lint/black.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

py-ruff:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l ruff
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.py'
        - '**/*.configure'
        - '**/.ruff.toml'
        - 'pyproject.toml'
        - 'tools/lint/ruff.yml'
        - 'tools/lint/python/ruff.py'
        - 'tools/lint/python/ruff_requirements.txt'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

yaml:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l yaml
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.yml'
        - '**/*.yaml'
        - '**/.ymllint'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

shellcheck:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l shellcheck
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.sh'
        - 'tools/lint/shellcheck.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

clang-format:
  extends: .base
  script:
    - ./mach configure --without-wasm-sandboxed-libraries --with-base-browser-version=0.0.0
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l clang-format
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.cpp'
        - '**/*.c'
        - '**/*.cc'
        - '**/*.h'
        - '**/*.m'
        - '**/*.mm'
        - 'tools/lint/clang-format.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

rustfmt:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l rustfmt
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.rs'
        - 'tools/lint/rustfmt.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

fluent-lint:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l fluent-lint
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.ftl'
        - 'tools/lint/fluent-lint.yml'
        - 'tools/lint/fluent-lint/exclusions.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

localization:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l l10n
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/locales/en-US/**'
        - '**/l10n.toml'
        - 'third_party/python/compare-locales/**'
        - 'third_party/python/fluent/**'
        - 'tools/lint/l10n.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

mingw-capitalization:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l mingw-capitalization
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.cpp'
        - '**/*.cc'
        - '**/*.c'
        - '**/*.h'
        - 'tools/lint/mingw-capitalization.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

mscom-init:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l mscom-init
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.cpp'
        - '**/*.cc'
        - '**/*.c'
        - '**/*.h'
        - 'tools/lint/mscom-init.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

file-whitespace:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l file-whitespace
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.c'
        - '**/*.cc'
        - '**/*.cpp'
        - '**/*.css'
        - '**/*.dtd'
        - '**/*.idl'
        - '**/*.ftl'
        - '**/*.h'
        - '**/*.html'
        - '**/*.md'
        - '**/*.properties'
        - '**/*.py'
        - '**/*.rs'
        - '**/*.rst'
        - '**/*.webidl'
        - '**/*.xhtml'
        - '**/*.java'
        - 'tools/lint/file-whitespace.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

test-manifest:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l test-manifest-alpha -l test-manifest-disable -l test-manifest-skip-if
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.ini'
        - 'python/mozlint/**'
        - 'tools/lint/**'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')

trojan-source:
  extends: .base
  script:
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l trojan-source
    - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -v
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      changes:
        # List copied from: taskcluster/ci/source-test/mozlint.yml
        #
        - '**/*.c'
        - '**/*.cc'
        - '**/*.cpp'
        - '**/*.h'
        - '**/*.py'
        - '**/*.rs'
        - 'tools/lint/trojan-source.yml'
    # Run job whenever a commit is merged to a protected branch
    - if: ($CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == 'true' && $CI_PIPELINE_SOURCE == 'push')