Commit 15fe5a4a authored by Yamada Hiroyuki's avatar Yamada Hiroyuki
Browse files

Merge branch 'HotFix_GitLabCI'

parents c821fa00 deeabe0d
Loading
Loading
Loading
Loading
Loading
+21 −42
Original line number Diff line number Diff line
variables: &global-variables
  CXX: "g++ -std=c++17 -O3 -march=native -Wall -Wextra -Icpprb -pthread"
  CC: "g++ -std=c++17 -O3 -march=native -Wall -Wextra -Icpprb -pthread"
  DOCKER_BUILDKIT: 1
  GIT_DEPTH: 10
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip"

stages:
  - build_image
  - export_org
  - build
  - page_build
  - page_deploy

.job_template: &setup
  image: &dev_image $CI_REGISTRY_IMAGE/build:latest
  before_script:
    - g++ --version
    - python3 --version
  except:
    - schedules

docker_build:
  image: docker:latest
  stage: build_image
  services:
    - docker:dind
  script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker pull $CI_REGISTRY_IMAGE/build:latest || true
    - docker build --pull=true --cache-from $CI_REGISTRY_IMAGE/build:latest -t $CI_REGISTRY_IMAGE/build:latest .
    - docker push $CI_REGISTRY_IMAGE/build:latest
  rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule"'
      when: always
    - if: '$CI_PIPELINE_SOURCE != "schedule"'
      when: manual
      allow_failure: true
.build_template: &build_env
  image: python:3.12
  variables:
    PIP_CACHE_DIR: "$CI_PROJECT_DIR/.pip"
  cache:
    - key:
        files:
          - pyproject.toml
          - setup.py
      paths:
        - "$PIP_CACHE_DIR"


cpprb_build:
  <<: *setup
  <<: *build_env
  stage: build
  needs:
    - README_MD
  script:
    - DEBUG_CPPRB=1 python3 setup.py build_ext --inplace --force
    - DEBUG_CPPRB=1 python3 setup.py bdist_wheel
    - pip wheel . -w dist --no-deps
  artifacts:
    paths:
      - cpprb/*.html
      - cpprb/*.cpp
      - cpprb/*.so
      - dist/*.whl
      - src/cpprb/*.html

emacs:
  image: iquiw/alpine-emacs
  stage: build
  stage: export_org
  script:
    - emacs --batch README.org -l site/init.el --eval '(setq debug-on-error t)' --eval '(org-hugo-export-wim-to-md :all-subtrees nil t)'
    - emacs --batch CHANGELOG.org -l site/init.el --eval '(org-hugo-export-wim-to-md :all-subtrees nil t)'
@@ -66,7 +46,7 @@ emacs:

README_MD:
  image: iquiw/alpine-emacs
  stage: build
  stage: export_org
  script:
    - emacs --batch README.org --eval '(org-md-export-to-markdown)'
  artifacts:
@@ -79,7 +59,6 @@ hugo:
  image: registry.gitlab.com/pages/hugo:latest
  stage: page_build
  variables:
    <<: *global-variables
    GIT_SUBMODULE_STRATEGY: recursive
  environment: production
  script:
@@ -95,7 +74,7 @@ hugo:
    - schedules

sphinx:
  image: *dev_image
  <<: *build_env
  stage: page_build
  environment: production
  script:
@@ -116,7 +95,7 @@ pages:
  environment: production
  script:
    - mkdir -p public/annotation
    - mv cpprb/*.html public/annotation/
    - mv src/cpprb/*.html public/annotation/
  artifacts:
    paths:
      - public