Codebase list python-faraday / 78dcaf8 .gitlab / ci / testing / .pretesting-gitlab-ci.yml
78dcaf8

Tree @78dcaf8 (Download .tar.gz)

.pretesting-gitlab-ci.yml @78dcaf8raw · history · blame

merge_conflict_check:
    tags:
        - faradaytests
    image: python:3
    stage: pre_testing
    allow_failure: true
    script:
        - git config --global user.email "[email protected]"
        - git config --global user.name "Mergerbot"
        - python3 scripts/merge-conflict-detector.py
    rules:
        - !reference [.dev-staging-master, rules]
        - !reference [.ignore-on-tag, rules]
        - when: never

sanity_check:
    tags:
        - faradaytests
    image: python:3
    stage: pre_testing
    script:
        - bash scripts/sanity_check_commit.sh
        - scripts/sanity_check_file.py --mode=ls
    rules:
        - !reference [.dev-staging-master, rules]
        - !reference [.ignore-on-tag, rules]
        - when: never

migration_sanity_check:
    tags:
        - faradaytests
    image: python:3
    stage: pre_testing
    script:
        - scripts/model_check.py
        - pip install .
        - cd faraday
        - $(alembic branches)
    rules:
        - !reference [.dev-staging-master, rules]
        - !reference [.ignore-on-tag, rules]
        - when: never

bandit:
    tags:
        - faradaytests
    image: python:3
    stage: pre_testing
    script:
      - pip3 install virtualenv
      - virtualenv -p python3 faraday_venv
      - source faraday_venv/bin/activate
      - pip3 install bandit
      - "bandit -r ${CI_PROJECT_DIR}/faraday --format custom --skip B101 --msg-template \
          \"{abspath}:{line}: {test_id}[bandit]: {severity}: {msg}\""
    rules:
        - !reference [.ignore-on-tag, rules]
        - when: on_success

build_and_push_to_cachix:
    tags:
        - faradaytests
    image: nixorg/nix
    stage: pre_testing
    variables:
      # Note: this size has to fit both our community, professional and corporate versions
      MAX_CLOSURE_SIZE_IN_MB: 850
    script:
        - nix-env -if pynixify/nixpkgs.nix -A vault
        - nix-env -if pynixify/nixpkgs.nix -A cachix
        - nix-env -if pynixify/nixpkgs.nix -A gawk
        - !reference [ .get_secrets, script ]
        - mkdir -p ~/.config/cachix
        - export USER=$(whoami)
        - echo "$CACHIX_CONFG" >~/.config/cachix/cachix.dhall
        - cachix use faradaysec
        - nix-build | cachix push faradaysec
        - ./scripts/check-closure-size ./result
    rules:
      - when: on_success

flake8:
    image: python:3
    stage: pre_testing
    script:
      - pip install flake8
      - flake8 .
    rules:
        - !reference [.ignore-on-tag, rules]
        - when: on_success

no-format-str:
    image: python:3
    stage: pre_testing
    script:
      - pip install flynt==0.69
      - flynt -df faraday tests
    rules:
        - !reference [.ignore-on-tag, rules]
        - !reference [.ignore-on-master, rules]
        - when: on_success