Skip to content

Commit

Permalink
Merge pull request #762 from Som-Energia/imp_reusable_ga
Browse files Browse the repository at this point in the history
Simplify and clean GA reusable workflow
  • Loading branch information
anxodio authored Nov 22, 2024
2 parents 1c7848e + 1d5e81c commit f4b3cb3
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/reusable_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
POSTGRES_USER: erp
POSTGRES_PASSWORD: erp
PYENV_ROOT: /home/runner/.pyenv
ROOT_DIR_SRC: ${{github.workspace}}/..

jobs:
build:
Expand Down Expand Up @@ -82,21 +83,20 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN_GA }}
run: |
export ROOT_DIR_SRC=${{github.workspace}}/..
git clone --depth 1 https://[email protected]/Som-Energia/erp.git -b ${{ inputs.erpbranch }} $ROOT_DIR_SRC/erp
git clone --depth 1 https://[email protected]/Som-Energia/libFacturacioATR.git $ROOT_DIR_SRC/libFacturacioATR
if [ ! -d "$ROOT_DIR_SRC/openerp_som_addons" ]; then
git clone --depth 1 https://github.com/Som-Energia/openerp_som_addons.git $ROOT_DIR_SRC/openerp_som_addons
git clone --depth 1 https://github.com/Som-Energia/openerp_som_addons.git $ROOT_DIR_SRC/openerp_som_addons
fi
if [ ! -d "$ROOT_DIR_SRC/somenergia-generationkwh" ]; then
git clone --depth 1 https://github.com/Som-Energia/somenergia-generationkwh.git $ROOT_DIR_SRC/somenergia-generationkwh
git clone --depth 1 https://github.com/Som-Energia/somenergia-generationkwh.git $ROOT_DIR_SRC/somenergia-generationkwh
fi
if [ ! -d "$ROOT_DIR_SRC/plantmeter" ]; then
git clone --depth 1 https://github.com/Som-Energia/plantmeter.git $ROOT_DIR_SRC/plantmeter
git clone --depth 1 https://github.com/Som-Energia/plantmeter.git $ROOT_DIR_SRC/plantmeter
fi
git clone --depth 1 https://github.com/Som-Energia/giscedata_facturacio_indexada_som.git $ROOT_DIR_SRC/giscedata_facturacio_indexada_som
if [ ! -d "$ROOT_DIR_SRC/oorq" ]; then
git clone --depth 1 https://github.com/gisce/oorq.git -b api_v5 $ROOT_DIR_SRC/oorq
git clone --depth 1 https://github.com/gisce/oorq.git -b api_v5 $ROOT_DIR_SRC/oorq
fi
git clone --depth 1 https://github.com/gisce/poweremail.git $ROOT_DIR_SRC/poweremail2
git clone --depth 1 https://github.com/gisce/openerp-sentry.git -b v5_legacy $ROOT_DIR_SRC/openerp-sentry
Expand All @@ -111,8 +111,6 @@ jobs:
run: |
sudo apt-get --allow-releaseinfo-change update
sudo apt-get install python2-dev python3-dev libxml2-dev libxmlsec1 libxmlsec1-dev libgdal-dev -y
export ROOT_DIR_SRC=${{github.workspace}}/..
cd $ROOT_DIR_SRC
cd $ROOT_DIR_SRC/libFacturacioATR
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
pip install -e .
Expand All @@ -123,7 +121,6 @@ jobs:
pip install -e . || "Not installing somenergia-generation Python package"
cd $ROOT_DIR_SRC/plantmeter
pip install -e . || "Not installing plantmeter Python package"
cd $ROOT_DIR_SRC
pip install -r $ROOT_DIR_SRC/erp/requirements-dev.txt
pip install -r $ROOT_DIR_SRC/erp/requirements.txt
Expand All @@ -136,26 +133,22 @@ jobs:
- name: Install dependencies for Python 2.7
if: matrix.python-version == '2.7'
run: |
export ROOT_DIR_SRC=${{github.workspace}}/..
git clone --depth 1 https://github.com/Som-Energia/somenergia-utils.git -b py2 $ROOT_DIR_SRC/somenergia-utils
cd $ROOT_DIR_SRC/somenergia-utils
pip install -e . || "Not installing somenergia-utils Python package"
pip install "dm.xmlsec.binding<=1.3.2"
- name: Link Addons
run: |
export ROOT_DIR_SRC=${{github.workspace}}/..
cd $ROOT_DIR_SRC/erp && ./tools/link_addons.sh
- name: Run Tests
env:
ESIOS_TOKEN: ${{ secrets.ESIOS_TOKEN }}
SRID: ${{ secrets.SRID }}
run: |
export ROOT_DIR_SRC=${{github.workspace}}/..
export CI_REPO=som-energia/openerp_som_addons
export CI_PULL_REQUEST=${{ github.event.number }}
export ROOT_DIR_SRC=${{github.workspace}}/..
export PYTHONPATH=${{github.workspace}}/../erp/server/bin:${{github.workspace}}/../erp/server/bin/addons:${{github.workspace}}/../erp/server/sitecustomize
export OPENERP_PRICE_ACCURACY=6
export OORQ_ASYNC=False
Expand Down

0 comments on commit f4b3cb3

Please sign in to comment.