ci(common): Fail CI if the PR to too much behind origin

And removes the docs generation/deploy part
This commit is contained in:
David Cermak
2023-04-25 14:17:10 +02:00
parent 6daf6c6ba6
commit 62be981c92
2 changed files with 26 additions and 24 deletions

View File

@@ -15,12 +15,14 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
ref: ${{ github.base_ref }} ref: ${{ github.base_ref }}
fetch-depth: 20
- name: Fetch head and base refs - name: Fetch head and base refs
# This is necessary for pre-commit to check the changes in the PR branch (and to set origin/HEAD and HEAD refs) # This is necessary for pre-commit to check the changes in the PR branch (and to set origin/HEAD and HEAD refs)
run: | run: |
git fetch origin ${{ github.event.pull_request.head.sha }}:pr_ref git fetch origin ${{ github.event.pull_request.head.sha }}:pr_ref
git checkout pr_ref git checkout pr_ref
git remote set-head origin --auto git remote set-head origin --auto
git merge-base origin/HEAD HEAD || ( echo "Your PR is far behind origin/HEAD, please rebase" && exit 1 )
- name: Set up Python environment - name: Set up Python environment
uses: actions/setup-python@master uses: actions/setup-python@master
with: with:

View File

@@ -43,27 +43,27 @@ jobs:
tag_name: ${{ env.BUMP_TAG }} tag_name: ${{ env.BUMP_TAG }}
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate docs # - name: Generate docs
shell: bash # shell: bash
run: | # run: |
sudo apt-get update # sudo apt-get update
sudo apt-get -y install doxygen clang python3-pip # sudo apt-get -y install doxygen clang python3-pip
python -m pip install breathe recommonmark esp-docs==1.4.1 # python -m pip install breathe recommonmark esp-docs==1.4.1
cd $GITHUB_WORKSPACE/docs # cd $GITHUB_WORKSPACE/docs
./generate_docs # ./generate_docs
- name: Deploying generated docs # - name: Deploying generated docs
if: always() # if: always()
shell: bash # shell: bash
run: | # run: |
source $GITHUB_WORKSPACE/docs/utils.sh # source $GITHUB_WORKSPACE/docs/utils.sh
add_doc_server_ssh_keys $DOCS_DEPLOY_KEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER # add_doc_server_ssh_keys $DOCS_DEPLOY_KEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
export GIT_VER=$(git describe --always) # export GIT_VER=$(git describe --always)
export GITHUB_REF_NAME=latest # export GITHUB_REF_NAME=latest
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs # export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs
deploy-docs # deploy-docs
- name: Upload components to component service # - name: Upload components to component service
uses: espressif/github-actions/upload_components@master # uses: espressif/github-actions/upload_components@master
with: # with:
directories: "components/esp_modem;components/esp_websocket_client;components/mdns;components/asio;components/esp_mqtt_cxx" # directories: "components/esp_modem;components/esp_websocket_client;components/mdns;components/asio;components/esp_mqtt_cxx"
namespace: "espressif" # namespace: "espressif"
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }} # api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}