Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.48 KiB
Newer Older
  • Learn to ignore specific revisions
  • variables:
      CONTAINER_REGISTRY: $CI_REGISTRY/georg/mat2-ci-images
    
      GIT_DEPTH: "5"
    
      GIT_STRATEGY: clone
    
    stages:
      - linting
      - test
    
    
    .prepare_env: &prepare_env
      before_script:  # This is needed to not run the testsuite as root
        - useradd --home-dir ${CI_PROJECT_DIR} mat2
        - chown -R mat2 .
    
    Julien (jvoisin) Voisin's avatar
    Julien (jvoisin) Voisin committed
    linting:ruff:
    
    georg's avatar
    georg committed
      image: $CONTAINER_REGISTRY:linting
    
      stage: linting
      script:
    
    Julien (jvoisin) Voisin's avatar
    Julien (jvoisin) Voisin committed
        - apt update
        - apt install -qqy --no-install-recommends python3-venv
        - python3 -m venv venv
        - source venv/bin/activate
        - pip3 install ruff
        - ruff check .
    
    linting:mypy:
    
      image: $CONTAINER_REGISTRY:linting
    
        - mypy --ignore-missing-imports mat2 libmat2/*.py
    
    tests:archlinux:
      image: $CONTAINER_REGISTRY:archlinux
      stage: test
      script:
    
        - python3 -m unittest discover -v
    
    tests:debian:
    
      image: $CONTAINER_REGISTRY:debian
    
      stage: test
    
      <<: *prepare_env
    
    Julien (jvoisin) Voisin's avatar
    Julien (jvoisin) Voisin committed
      script:
    
        - apt-get -qqy purge bubblewrap
    
        - su - mat2 -c "python3-coverage run --branch -m unittest discover -s tests/"
        - su - mat2 -c "python3-coverage report --fail-under=95 -m --include 'libmat2/*'"
    
    
    tests:debian_with_bubblewrap:
    
      image: $CONTAINER_REGISTRY:debian
    
      allow_failure: true
    
        - apt-get -qqy install bubblewrap
        - python3 -m unittest discover -v
    
    
    tests:fedora:
    
      image: $CONTAINER_REGISTRY:fedora
    
      stage: test
      script:
    
        - python3 -m unittest discover -v
    
    tests:gentoo:
      image: $CONTAINER_REGISTRY:gentoo
    
      stage: test
    
        - su - mat2 -c "python3 -m unittest discover -v"
    
    
    tests:python3.7:
      image: $CONTAINER_REGISTRY:python3.7
      stage: test
      script:
        - python3 -m unittest discover -v
    
    tests:python3.8:
      image: $CONTAINER_REGISTRY:python3.8
      stage: test
      script:
        - python3 -m unittest discover -v
    
    tests:python3.9:
      image: $CONTAINER_REGISTRY:python3.9
      stage: test
      script:
        - python3 -m unittest discover -v
    
    tests:python3.10:
      image: $CONTAINER_REGISTRY:python3.10
      stage: test
      script:
        - python3 -m unittest discover -v
    
    tests:python3.11:
      image: $CONTAINER_REGISTRY:python3.11
      stage: test
      script:
        - python3 -m unittest discover -v
    
    
    tests:python3.12:
      image: $CONTAINER_REGISTRY:python3.12
      stage: test
      script:
        - python3 -m unittest discover -v
    
    georg's avatar
    georg committed
    
    tests:python3.13:
      image: $CONTAINER_REGISTRY:python3.13
      stage: test
      script:
        - python3 -m unittest discover -v
    
    tests:python3.14:
      image: $CONTAINER_REGISTRY:python3.14
      stage: test
      script:
        - python3 -m unittest discover -v