Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.89 KiB
variables:
  PROJECT: 'colibri'
  ID: '804'
  PROJECT_URI: 'https://git.frama-c.com/api/v4/projects/$ID'

stages:
  - build
  - test

build:
  image: ocaml/opam:debian-10-ocaml-4.14
  stage: build
  script:
   - sudo apt-get update
   - sudo apt-get install -y make libgmp-dev
   - opam install dune.3.12.1 fmt.0.9.0 gen.1.1 menhir.20230608 ocplib-simplex.0.5 parsexp.v0.16.0 spelll.0.4 uutf.1.0.3 zarith.1.13
   - make clean
   - make clean_bundle
   - make
   - make bundle
   - make bundle.tbz
  artifacts:
    paths:
     - bundle
     - bundle.tbz
    expire_in: 1 week
  tags:
    - docker

test:
  image: debian:10
  stage: test
  needs: [build]
  script:
    - apt-get update
    - apt-get install -y make parallel
    - make test
  artifacts:
    paths:
      - logs
    expire_in: 1 week
  tags:
    - docker

prepare-release:
  image: debian:10
  needs: [build]
  rules:
    - if: $CI_PIPELINE_SOURCE == "trigger"
  variables:
    ARCHIVE_NAME: '$PROJECT.$TAG.tbz'
    PACKAGE_URI: '$PROJECT_URI/$PROJECT/$TAG/$ARCHIVE_NAME'
  script:
    - apt-get update
    - apt-get install -y curl
    - sed -n -f changelog.sed CHANGES.md > description.txt
    - |
      curl --header "PRIVATE-TOKEN: $CI_JOB_TOKEN" --upload-file bundle.tbz "$PACKAGE_URI"
  artifacts:
    paths:
      - description.txt
  tags:
    - docker

release:
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  needs: [prepare-release]
  rules:
    - if: $CI_PIPELINE_SOURCE == "trigger"
  variables: