Build & E2E Tests #547
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & E2E Tests | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- v* | |
workflow_dispatch: | |
inputs: | |
force_regen_doc: | |
description: "Force regenerate doc site" | |
required: false | |
default: true | |
type: boolean | |
schedule: | |
- cron: "0 12 * * *" | |
jobs: | |
update_doc_build: | |
# uses: PaddleCV-SIG/PaddleLabel/.github/workflows/doc_to_pages.yml@develop | |
uses: ./.github/workflows/doc_to_pages.yml | |
with: | |
baseurl: "/static/doc/" | |
deploy: false | |
# force_regen: ${{ inputs.force_regen_doc }} | |
force_regen: true | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
needs: update_doc_build | |
steps: | |
- name: Checkout backend code | |
uses: actions/checkout@v3 | |
- name: Download built frontend | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: build.yml | |
workflow_conclusion: success | |
repo: PaddleCV-SIG/PaddleLabel-Frontend | |
name: PaddleLabel_built_frontend | |
path: ./paddlelabel/static/ | |
search_artifacts: true | |
- name: Download built doc static site | |
uses: actions/download-artifact@v3 | |
# uses: dawidd6/action-download-artifact@v2 | |
with: | |
# workflow_conclusion: "" | |
# branch: develop | |
name: github-pages | |
# search_artifacts: true | |
# check_artifacts: true | |
path: ./paddlelabel/static/doc/ | |
- name: Unarchive doc site | |
run: | | |
cd ./paddlelabel/static/doc/ | |
ls | |
tar -xvf artifact.tar | |
rm artifact.tar | |
tree . | |
cd - | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install --upgrade twine wheel | |
- name: Write backend commit hash to package | |
run: | | |
echo backend $(git rev-parse --short HEAD) >> ./paddlelabel/static/git_versions.html | |
- name: Generate package | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Set action summary | |
run: | | |
echo " | |
# Build Summary | |
branch: $(git branch --show-current) | |
version: $(cat paddlelabel/version) | |
" >> $GITHUB_STEP_SUMMARY | |
- name: Save built package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: PaddleLabel_built_package | |
path: | | |
dist | |
cypress_e2e_test: | |
needs: build | |
# uses: PaddleCV-SIG/PaddleLabel/.github/workflows/cypress.yml@develop | |
uses: ./.github/workflows/cypress.yml | |
bump_version: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] | |
needs: cypress_e2e_test | |
steps: | |
- name: Checkout backend code | |
uses: actions/checkout@v3 | |
- name: Bump version | |
id: bump_version | |
# if: github.event_name == 'push' | |
run: | | |
python tool/bumpversion.py | |
git config --global user.email "[email protected]" && git config --global user.name "Action Bot" | |
git add paddlelabel/version; git commit -m "bump version"; git push |