Github Actions 5 years ago
parent
commit
0548c5f5f7
  1. 69
      .github/workflows/DINAR-pr.yml

69
.github/workflows/DINAR-pr.yml

@ -65,51 +65,20 @@ jobs:
# sets environment variables that available in next steps via $ {{ env.PR_... }} notation # sets environment variables that available in next steps via $ {{ env.PR_... }} notation
cd REPO cd REPO
python ../DINAR/workflow-files/analyze-modules.py updated ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.number }} python ../DINAR/workflow-files/analyze-modules.py updated ${{ secrets.GITHUB_TOKEN }} ${{ github.repository }} ${{ github.event.number }}
- name: HOW TO RUN LOCALLY
#if: "env.PR_MODULES != ''"
- name: Configure docker
run: |
bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN || secrets.GITHUB_TOKEN }}
echo "::set-env name=PR_FILES::../../REPO"
- name: HOW TO RUN ODOO LOCALLY
if: always()
run: | run: |
cat << 'EOF'
To test updates run:
WORKDIR=/tmp/DINAR/${{ github.repository }}-${{ github.event.number }}/
mkdir -p $WORKDIR
cd $WORKDIR
# TODO use fixed version instead of master
curl https://raw.githubusercontent.com/itpp-labs/DINAR/master/local-files/docker-compose.yml > docker-compose.yml
export REGISTRY=docker.pkg.github.com REPOSITORY=${{ github.repository }} REPO_NAME=$(echo ${{ github.repository }} | sed "s;.*/;;") VERSION=${{ github.event.pull_request.base.ref }}
git clone --depth=1 --branch $VERSION git@github.com:${{ github.repository }} pr-files
# Version in PR
REVISION=${{ github.event.pull_request.head.sha}}
# Version after merging
REVISION=pull/${{ github.event.number}}/merge
git -C pr-files fetch origin $REVISION
git -C pr-files checkout FETCH_HEAD
docker-compose pull
export MODULES=${{ env.PR_MODULES }} export MODULES=${{ env.PR_MODULES }}
export LOAD_MODULES=${{ env.PR_MODULES_LOAD }} export LOAD_MODULES=${{ env.PR_MODULES_LOAD }}
EOF
if [ "${{ github.event.pull_request.base.ref }}" == "10.0" ]; then
cat << 'EOF'
# workaround for odoo 10.0
docker-compose up -d odoo
docker-compose exec odoo click-odoo -i
# EXEC:
# env['ir.module.module'].update_list()
# env.cr.commit()
# exit()
docker-compose stop odoo
EOF
fi
cat << 'EOF'
docker-compose up
EOF
# TODO: post this message when Github guys make access to post message in PR
#> Sent by [DINAR :construction_worker_man:](https://github.com/itpp-labs/DINAR) via `.github/workflows/DINAR-pr.yml`
export PR_NUM=${{ github.event.number }}
export VERSION=${{ github.event.pull_request.base.ref }}
export REVISION_PR=${{ github.event.pull_request.head.sha}}
export DINAR_REPO="itpp-labs/DINAR-fork"/
bash DINAR/workflow-files/how-to-run-locally.sh
- name: Check Python Version - name: Check Python Version
run: run:
echo "::set-env name=PY::$(python --version --version | sha256sum | cut -d' ' echo "::set-env name=PY::$(python --version --version | sha256sum | cut -d' '
@ -247,6 +216,21 @@ jobs:
DEPS_MODULES=$(cat new-deps/modules.txt || true) DEPS_MODULES=$(cat new-deps/modules.txt || true)
cd REPO cd REPO
python ../DINAR/workflow-files/analyze-modules.py all "$DEPS_MODULES" python ../DINAR/workflow-files/analyze-modules.py all "$DEPS_MODULES"
- name: Install json parser
run: |
sudo apt-get install jq
- name: HOW TO RUN TESTS LOCALLY
if: always()
# TODO make similar for Quick Tests
run: |
export MODULES=${{ env.ALL_MODULES }}
export LOAD_MODULES=${{ env.ALL_MODULES_LOAD }}
export PR_NUM=${{ github.event.number }}
export VERSION=${{ github.event.pull_request.base.ref }}
export REVISION_PR=${{ github.event.pull_request.head.sha}}
export DINAR_REPO="itpp-labs/DINAR-fork"/
export ODOO_EXTRA_ARG=--test-enable
bash DINAR/workflow-files/how-to-run-locally.sh ${{ secrets.GITHUB_TOKEN }}
- name: Download base images - name: Download base images
run: | run: |
docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config docker-compose -p DINAR -f DINAR/workflow-files/docker-compose-DINAR-pr.yml config
@ -256,7 +240,6 @@ jobs:
if: env.ARTIFACT != 'empty' if: env.ARTIFACT != 'empty'
run: | run: |
bash DINAR/workflow-files/load-docker-layers.sh new-deps/ bash DINAR/workflow-files/load-docker-layers.sh new-deps/
- name: Test all modules - name: Test all modules
run: | run: |
export MODULES="${{ env.ALL_MODULES }}" export MODULES="${{ env.ALL_MODULES }}"

Loading…
Cancel
Save