diff --git a/.github/workflows/v2-build-demos-swc-env.yml b/.github/workflows/v2-build-demos-swc-env.yml index 6d5893365c..1945c5894a 100644 --- a/.github/workflows/v2-build-demos-swc-env.yml +++ b/.github/workflows/v2-build-demos-swc-env.yml @@ -2,6 +2,7 @@ name: V2 Build Demos for SWC Environment on: push: + # TODO: Remove 'test-v2-master' and 'test-v2-dev' for release branches: - master - test-v2-master @@ -80,3 +81,36 @@ jobs: name: deployment_build_context path: /tmp/merge retention-days: 30 + + # Step 4: Build and upload the updated objects.inv files + build-objects-inv-file-dev: + # TODO: Change ref_name to 'dev' for release + if: (needs.identify-changed-demos.outputs.updated != '') && ${{ github.ref_name == 'test-v2-dev' }} + uses: ./.github/workflows/v2-sync-objects-dot-inv.yml + needs: + - identify-changed-demos + with: + branch: ${{ github.ref }} + dev: true + + secrets: + aws_region: ${{ secrets.AWS_REGION }} + aws_access_key_id: ${{ secrets.PL_SITE_DEV_NON_REACT_ACCESS_KEY_ID }} + aws_secret_access_key: ${{ secrets.PL_SITE_DEV_NON_REACT_SECRET_ACCESS_KEY }} + aws_html_s3_bucket_id: ${{ secrets.PL_SITE_DEV_S3_BUCKET_NAME }} + + build-objects-inv-file-master: + # TODO: Change ref_name to 'master' for release + if: (needs.identify-changed-demos.outputs.updated != '') && ${{ github.ref_name == 'test-v2-master' }} + uses: ./.github/workflows/v2-sync-objects-dot-inv.yml + needs: + - identify-changed-demos + with: + branch: ${{ github.ref }} + + secrets: + # TODO: Change STAGING to PROD for release + aws_region: ${{ secrets.AWS_REGION }} + aws_access_key_id: ${{ secrets.PL_SITE_STAGING_NON_REACT_ACCESS_KEY_ID }} + aws_secret_access_key: ${{ secrets.PL_SITE_STAGING_NON_REACT_SECRET_ACCESS_KEY }} + aws_html_s3_bucket_id: ${{ secrets.PL_SITE_STAGING_S3_BUCKET_NAME }} diff --git a/.github/workflows/v2-sync-objects-dot-inv.yml b/.github/workflows/v2-sync-objects-dot-inv.yml new file mode 100644 index 0000000000..0b557a3249 --- /dev/null +++ b/.github/workflows/v2-sync-objects-dot-inv.yml @@ -0,0 +1,69 @@ +name: V2 Sync objects.inv +on: + workflow_call: + inputs: + branch: + description: The QML branch that is being built. + type: string + required: true + dev: + description: Use development dependencies. + required: false + type: boolean + default: false + + secrets: + aws_region: + description: The AWS Region the infrastructure resides in + required: true + aws_access_key_id: + description: AWS Access Key to use when accessing the S3 bucket + required: true + aws_secret_access_key: + description: AWS Secret Access Key to use when accessing the S3 bucket + required: true + aws_html_s3_bucket_id: + description: The S3 bucket ID where the objects.inv file will be pushed + required: true + + +jobs: + build-and-upload: + runs-on: ubuntu-latest + env: + AWS_REGION: ${{ secrets.aws_region }} + AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} + AWS_S3_HTML_BUCKET_ID: ${{ secrets.aws_html_s3_bucket_id }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ inputs.branch }} + fetch-depth: 1 + + - name: Install pandoc and opencl + run: | + sudo apt-get install -y \ + ocl-icd-opencl-dev \ + pandoc + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install dependencies + run: pip install . && poetry config warnings.export false + + - name: Build all demos in HTML format + run: | + qml build \ + --format html \ + --keep-going \ + --no-quiet \ + ${{ inputs.dev && '--dev' || '--no-dev' }} + + - name: Sync objects.inv to HTML Bucket + run: aws s3 cp ./_build/objects.inv s3://$AWS_S3_HTML_BUCKET_ID/qml/objects.inv diff --git a/.gitignore b/.gitignore index bc97193548..cfb4691bb3 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ demos_community.rst .venv/ .venv-build/ **/*.egg-info/ +sg_execution_times.rst # Generated after installation .github/workflows/qml_pipeline_utils/build/