Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.69 KiB
Newer Older
  • Learn to ignore specific revisions
  • q3k's avatar
    q3k committed
    stages:
    
      - check
    
    q3k's avatar
    q3k committed
      - build
    
    q3k's avatar
    q3k committed
    
    
    q3k's avatar
    q3k committed
    variables:
      GIT_SUBMODULE_STRATEGY: recursive
    
    
    default:
      # built via:
      #     docker load < $(nix-build nix/docker-image.nix)
    
    q3k's avatar
    q3k committed
      image: registry.k0.hswaw.net/q3k/flow3r-build:wlzk2mlpfymmpzbi4cs6vlgmbviz0pl1
    
    
    clang-tidy:
      stage: check
      script:
    
        - "bash tools/clang-tidy.sh"
    
    q3k's avatar
    q3k committed
        - "python3 tools/codequal-report.py clang-tidy warnings.txt > cqual.json"
    
      artifacts:
        when: always
        reports:
    
    q3k's avatar
    q3k committed
          codequality: cqual.json
    
    mypy:
      stage: check
      variables:
        MYPYPATH: python_payload/mypystubs
      script:
        - "set +e +o pipefail"
    
    q3k's avatar
    q3k committed
        - "mypy python_payload/main.py --strict --no-color-output > warnings.txt; result=$?"
    
    q3k's avatar
    q3k committed
        - "python3 tools/codequal-report.py mypy warnings.txt > cqual.json"
        - "set -e -o pipefail"
        - "[ $result == 0 ]"
      artifacts:
        when: always
        reports:
          codequality: cqual.json
    
    q3k's avatar
    q3k committed
    format:
      stage: check
      script:
    
    q3k's avatar
    q3k committed
        - "git clean -fdx"
    
    q3k's avatar
    q3k committed
        - "bash tools/format.sh"
    
    q3k's avatar
    q3k committed
        - "[ -z \"$(git status --porcelain)\" ] || (echo 'Differences found, please run tools/format.sh.' && git diff HEAD && exit 1)"
    
    q3k's avatar
    q3k committed
    
    
    q3k's avatar
    q3k committed
    build-p3:
      stage: build
      script:
    
        - idf.py -g p3 build
    
    q3k's avatar
    q3k committed
      artifacts:
        expose_as: 'Proto 3 ELF'
    
    q3k's avatar
    q3k committed
        paths: ['build/flow3r.elf']
    
        expire_in: 5 hours
    
    q3k's avatar
    q3k committed
    
    build-p4:
      stage: build
      script:
    
        - idf.py -g p4 build
    
    q3k's avatar
    q3k committed
      artifacts:
        expose_as: 'Proto 4 ELF'
    
    q3k's avatar
    q3k committed
        paths: ['build/flow3r.elf']
    
        expire_in: 5 hours
    
    q3k's avatar
    q3k committed
    
    build-p6:
      stage: build
      script:
    
        - idf.py -g p6 build
    
    q3k's avatar
    q3k committed
      artifacts:
        expose_as: 'Proto 6 ELF'
    
    q3k's avatar
    q3k committed
        paths: ['build/flow3r.elf']
    
        expire_in: 5 hours
    
    pages:
      stage: deploy
      only:
        - main
    
      script:
        - cd docs
        - make html
        - mv _build/html ../public
      artifacts:
        paths: ['public']
    
        expire_in: 1d