fix(deps): update material-ui monorepo to v9 #789
This file contains hidden or 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: Gubbins extension Tests | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'packages/diracx-web/**' | |
| branches-ignore: | |
| - renovate/** | |
| - release-please-** | |
| pull_request: | |
| branches-ignore: | |
| - release-please-** | |
| jobs: | |
| # Run lint and type checks | |
| run-lint: | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| # ========================================================================# | |
| # WARNING: In your CI/CD pipeline, you should remove the following step # | |
| # ------------------------------------------------------------------------# | |
| - name: Build Library | |
| run: npm run build:diracx-web-components | |
| # ------------------------------------------------------------------------# | |
| # ========================================================================# | |
| - name: Check code-quality rules | |
| run: npm --prefix packages/extensions run lint | |
| - name: Check typescript type validity | |
| run: npm --prefix packages/extensions run ts-lint | |
| # ============================================================================# | |
| # WARNING: In your CI/CD pipeline, you should remove the following jobs # | |
| # ----------------------------------------------------------------------------# | |
| # By default, the gubbins extension is part of a monorepo and uses a local # | |
| # version of `diracx-web-components`. This default setup is not # | |
| # representative of a standalone extension configuration. Here we want to # | |
| # closely mimic a standalone extension. To do so, we: # | |
| # - Isolate the packages/extensions directory: Move its content to a new # | |
| # repository or directory outside the monorepo. # | |
| # - Update Configuration: Adjust relevant variables to align with a # | |
| # standalone setup. # | |
| prepare-gubbins-backend: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' }} | |
| steps: | |
| - name: Clone source | |
| run: | | |
| cd .. | |
| git clone https://github.com/DIRACGrid/diracx.git | |
| # Build gubbins container images using pixi | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build gubbins services image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ../diracx | |
| file: ../diracx/containers/Dockerfile | |
| build-args: | | |
| PIXI_ENV=gubbins-container-services | |
| tags: ghcr.io/gubbins/services:dev | |
| outputs: type=docker,dest=/tmp/gubbins_services_image.tar | |
| - name: Build gubbins client image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ../diracx | |
| file: ../diracx/containers/Dockerfile | |
| build-args: | | |
| PIXI_ENV=gubbins-container-client | |
| tags: ghcr.io/gubbins/client:dev | |
| outputs: type=docker,dest=/tmp/gubbins_client_image.tar | |
| - name: Upload gubbins images | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: gubbins-images | |
| path: /tmp/gubbins_*_image.tar | |
| prepare-gubbins-frontend-as-a-standalone: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build diracx-web-components | |
| working-directory: packages/diracx-web-components | |
| run: | | |
| npm pack | |
| - name: Where the magic happens (Move extensions to a temporary directory) | |
| run: | | |
| # Move the extensions to the temporary directory | |
| cp -r packages/extensions /tmp/gubbins-web | |
| # Move the library package to the extensions directory | |
| mv packages/diracx-web-components/*.tgz /tmp/gubbins-web/diracx-web-components.tgz | |
| # Update the package.json to point to the local diracx-web-components | |
| jq '.dependencies["@dirac-grid/diracx-web-components"] = "file:./diracx-web-components.tgz"' /tmp/gubbins-web/package.json > /tmp/gubbins-web/package.temp.json | |
| mv /tmp/gubbins-web/package.temp.json /tmp/gubbins-web/package.json | |
| # Update the package.json to point to the correct postinstall script | |
| jq '.scripts.postinstall = "node ./node_modules/@axa-fr/react-oidc/bin/copy-service-worker-files.mjs public"' /tmp/gubbins-web/package.json > /tmp/gubbins-web/package.temp.json | |
| mv /tmp/gubbins-web/package.temp.json /tmp/gubbins-web/package.json | |
| # Update the next.config.js to prevent the standalone extension from searching a local version of diracx-web-components that does not exist | |
| echo 'const nextConfig = { output: "export", images: { unoptimized: true }}; export default nextConfig;' > /tmp/gubbins-web/next.config.js | |
| - name: Install extensions dependencies | |
| working-directory: /tmp/gubbins-web | |
| run: npm install | |
| - name: Upload the extensions directory | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: gubbins-web | |
| path: /tmp/gubbins-web | |
| retention-days: 1 | |
| include-hidden-files: true | |
| # ----------------------------------------------------------------------------# | |
| # In the following jobs, you should: # | |
| # - Replace /tmp/gubbins-web with the path to your extension source code # | |
| # - Remove the `needs: prepare-gubbins-as-a-standalone` line # | |
| # ============================================================================# | |
| # Build the extension image | |
| build-gubbins-dev-image: | |
| runs-on: ubuntu-latest | |
| needs: prepare-gubbins-frontend-as-a-standalone | |
| if: ${{ github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to GitHub container registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # ========================================================================# | |
| # WARNING: In your CI/CD pipeline, you should remove the following steps # | |
| # ------------------------------------------------------------------------# | |
| - name: Download gubbins-web | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: gubbins-web | |
| path: /tmp/gubbins-web | |
| # ------------------------------------------------------------------------# | |
| # ========================================================================# | |
| # In your extension, you have to push the image to the registry (check deployment.yml) | |
| - name: Build Docker image (extension example) | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: /tmp/gubbins-web | |
| push: false | |
| tags: ghcr.io/diracgrid/diracx-web/gubbins:dev | |
| platforms: linux/amd64,linux/arm64 | |
| # Run the demo with the extension source code (frontend and backend) | |
| run-demo: | |
| runs-on: ubuntu-latest | |
| needs: [prepare-gubbins-frontend-as-a-standalone, prepare-gubbins-backend] | |
| if: github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Clone source | |
| run: | | |
| cd .. | |
| git clone https://github.com/DIRACGrid/diracx-charts.git | |
| # ========================================================================# | |
| # WARNING: In your CI/CD pipeline, you should remove the following steps # | |
| # ------------------------------------------------------------------------# | |
| - name: Clone diracx source | |
| run: | | |
| cd .. | |
| git clone https://github.com/DIRACGrid/diracx.git | |
| - name: Download gubbins images | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: gubbins-images | |
| path: /tmp/ | |
| - name: Load gubbins images | |
| run: | | |
| docker load --input /tmp/gubbins_services_image.tar | |
| rm -f /tmp/gubbins_services_image.tar | |
| docker load --input /tmp/gubbins_client_image.tar | |
| rm -f /tmp/gubbins_client_image.tar | |
| - name: Download gubbins-web | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: gubbins-web | |
| path: /tmp/gubbins-web | |
| # ------------------------------------------------------------------------# | |
| # ========================================================================# | |
| # Runs the demo with the extension source code | |
| - name: Start demo | |
| run: | | |
| cd .. | |
| # Download helm/kubectl/kind first | |
| diracx-charts/run_demo.sh --only-download-deps | |
| # Copy gubbins-charts to a temporary location and build dependencies | |
| cp -r ./diracx/extensions/gubbins-charts /tmp/ | |
| diracx-charts/.demo/helm dependency build /tmp/gubbins-charts | |
| # Replace the downloaded subchart with the locally-cloned one to | |
| # ensure we have the pixi-compatible ConfigMap entrypoint | |
| rm -f /tmp/gubbins-charts/charts/diracx-*.tgz | |
| diracx-charts/.demo/helm package diracx-charts/diracx -d /tmp/gubbins-charts/charts/ | |
| diracx-charts/run_demo.sh \ | |
| --exit-when-done \ | |
| --set-value diracx.developer.autoReload=false \ | |
| --extension-chart-path /tmp/gubbins-charts \ | |
| --ci-values ./diracx/extensions/gubbins_values.yaml \ | |
| --load-docker-image "ghcr.io/gubbins/services:dev" \ | |
| --load-docker-image "ghcr.io/gubbins/client:dev" \ | |
| --prune-loaded-images \ | |
| /tmp/gubbins-web/ | |
| - name: Debugging information | |
| run: | | |
| cd ../diracx-charts | |
| export KUBECONFIG=$PWD/.demo/kube.conf | |
| .demo/kubectl get pods | |
| for pod_name in $(.demo/kubectl get pods -o json | jq -r '.items[] | .metadata.name' | grep -vE '(dex|minio|mysql|rabbitmq|opensearch)'); do | |
| echo "${pod_name}" | |
| .demo/kubectl describe pod/"${pod_name}" || true | |
| for container_name in $(.demo/kubectl get pods $pod_name -o jsonpath='{.spec.initContainers[*].name} {.spec.containers[*].name}'); do | |
| echo $pod_name $container_name | |
| .demo/kubectl logs "${pod_name}" -c "${container_name}" || true | |
| done | |
| done | |
| - name: Check for success | |
| run: | | |
| cd ../diracx-charts | |
| if [ ! -f ".demo/.success" ]; then | |
| echo "Demo failed" | |
| cat ".demo/.failed" | |
| exit 1 | |
| fi | |
| # Find the URL to be tested and put it in the github environment for the next step | |
| - name: Set DIRACX_URL | |
| run: echo "DIRACX_URL=https://$(ifconfig | grep 'inet ' | awk '{ print $2 }' | grep -v '^127' | head -n 1 | cut -d '/' -f 1).nip.io:8000" >> $GITHUB_ENV | |
| # Run e2e tests with Cypress | |
| - name: Start Cypress | |
| uses: cypress-io/github-action@v6 | |
| with: | |
| browser: chrome | |
| config: baseUrl=${{ env.DIRACX_URL }} | |
| project: /tmp/gubbins-web | |
| - name: Upload Cypress screenshots | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: cypress-screenshots | |
| path: /tmp/gubbins-web/cypress/screenshots |