Commit 117da85a authored by Davide Ricci's avatar Davide Ricci
Browse files

Update .gitlab-ci.yml file

parent 0a3ccdd0
Loading
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -3,9 +3,10 @@
image: python:3.12

variables:
  PROJECT: "noctua"
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  FORMAT_TARGETS: "noctua" # For sed, autopep8, isort
  PYLINT_TARGETS: "noctua" # For pylint
  FORMAT_TARGETS: "$PROJECT" # For sed, autopep8, isort
  PYLINT_TARGETS: "$PROJECT" # For pylint
  GIT_USER_EMAIL: "davide.ricci@inaf.it"
  GIT_USER_NAME: "Davide GitLab CI"
  FORMATTED_BRANCH_NAME: "validated"
@@ -21,8 +22,8 @@ stages:
  - lint # A stage for checks that don't modify code (like pylint)
  - auto_commit 

# Job 1: Install Noctua and its dependencies
install_noctua:
# Job 1: Install $PROJECT and its dependencies
install_project:
  stage: setup_and_format 
  tags:
    - git-run-ia2 
@@ -31,9 +32,9 @@ install_noctua:
    - ls -la
    - echo "Python version $(python -v)"
    - pip install --upgrade pip
    - echo "Installing project 'noctua' and its dependencies..."
    - echo "Installing project '$PROJECT' and its dependencies..."
    - pip install -e .
    - echo "Noctua installation complete."
    - echo "$PROJECT installation complete."
  artifacts:
    paths:
      # Pass the entire workspace. This includes the checked-out code
@@ -46,7 +47,7 @@ fix_trailing_whitespaces:
  tags:
    - git-run-ia2
  needs:
    - job: install_noctua
    - job: install_project
      artifacts: true
  script:
    - echo "Current directory $(pwd)"
@@ -130,12 +131,12 @@ commit_formatted_code:
    - job: apply_autopep8 # Needs the final code state from formatting
      artifacts: true
  before_script:
    - git fetch origin $(FORMATTED_BRANCH_NAME)
    - git checkout $(FORMATTED_BRANCH_NAME)
    - git fetch origin ${FORMATTED_BRANCH_NAME}
    - git checkout ${FORMATTED_BRANCH_NAME}
    - git config --global user.email "davide.ricci@inaf.it"
    - git config --global user.name "CI Bot"
  script:
    - echo "Pushing on $(FORMATTED_BRANCH_NAME) branch..."
    - echo "Pushing on ${FORMATTED_BRANCH_NAME} branch..."
  after_script:
    - git add .
    - MAIN_COMMIT_MSG=$(git log -1 --pretty=%B $CI_COMMIT_SHA)