Select Git revision
.gitlab-ci.yml

Emmanuel Raviart authored
.gitlab-ci.yml 2.12 KiB
stages:
- build
- deploy
- anaconda
ci:
stage: build
image: node:18-bookworm
cache:
paths:
- node_modules
before_script:
# Without apt update, apt install fails.
- apt update --yes
# Install ssh-agent if not already installed, it is required by Docker.
- "which ssh-agent || apt install -y openssh-client"
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
- apt install --yes python-is-python3 python3-venv
- curl -sSL https://install.python-poetry.org/ | python -
# Add Poetry to path:
- export PATH="/root/.local/bin:$PATH"
# Ensure that Poetry creates and uses virtualenvs in .venv directory of each project.
- poetry config virtualenvs.in-project true
- npm install
# Needed when Node version changes:
- npm rebuild
# Compile gitlab-ci TypeScript script.
- npx tsc --declaration --project gitlab-ci/tsconfig.json
script:
# Execute gitlab-ci JavaScript script.
- node --experimental-specifier-resolution=node gitlab-ci/build/gitlab-ci.js
tax_benefit_ci:
stage: build
image: curlimages/curl:latest
variables:
OPENFISCA_PROJECT_NAME: openfisca-france
OPENFISCA_PYTHON_PACKAGE: openfisca_france_with_indirect_taxation
script:
- |
env | curl --data-binary @- --fail-with-body --header "Content-Type: text/plain; charset=utf-8" --max-time 300 --silent https://control-center.tax-benefit.org/api/gitlab/ci
# deploy_pypi:
# stage: deploy
# needs: ["ci", "tax_benefit_ci"]
# image: python:3.8-slim
# script:
# - python3 -m pip install --upgrade build
# - python3 -m pip install --upgrade twine
# - python3 -m build
# - twine upload dist/* --username __token__ --password $PYPI_TOKEN
# only:
# - master
# deploy_conda:
# stage: anaconda
# needs: ["deploy_pypi"]
# image: continuumio/miniconda3
# script:
# - python3 gitlab-ci/src/get_pypi_info.py -p openfisca-france-reforms
# - conda install -y conda-build anaconda-client
# - conda config --set anaconda_upload yes
# - conda build -c conda-forge --token $ANACONDA_TOKEN --user Leximpact .conda
# only:
# - master