1name: xcm-testnet-build234on: [pull_request]56 7 workflow_dispatch:89#Define Workflow variables10env:11 REPO_URL: ${{ github.server_url }}/${{ github.repository }}1213concurrency:14 group: ${{ github.workflow }}-${{ github.head_ref }}15 cancel-in-progress: true1617# A workflow run is made up of one or more jobs that can run sequentially or in parallel18jobs:1920 prepare-execution-marix:2122 name: Prepare execution matrix2324 runs-on: XL25 outputs:26 matrix: ${{ steps.create_matrix.outputs.matrix }}2728 steps:2930 - name: Clean Workspace31 uses: AutoModality/action-clean@v1.1.03233 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it34 - uses: actions/checkout@v335 with:36 ref: ${{ github.head_ref }} #Checking out head commit3738 - name: Read .env file39 uses: xom9ikk/dotenv@v1.0.24041 - name: Create Execution matrix42 uses: fabiocaccamo/create-matrix-action@v243 id: create_matrix44 with:45 matrix: |46 network {opal}, runtime {opal}, features {opal-runtime}47 network {quartz}, runtime {quartz}, features {quartz-runtime}48 network {unique}, runtime {unique}, features {unique-runtime}4950 xcm-build:51 52 needs: prepare-execution-marix53 # The type of runner that the job will run on54 runs-on: [XL]5556 timeout-minutes: 6005758 name: ${{ matrix.network }}5960 continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.6162 strategy:63 matrix:64 include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}656667 steps:68 #- name: Skip if pull request is in Draft69 # if: github.event.pull_request.draft == true70 # run: exit 17172 - name: Clean Workspace73 uses: AutoModality/action-clean@v1.1.07475 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it76 - uses: actions/checkout@v377 with:78 ref: ${{ github.head_ref }} #Checking out head commit7980 - name: Read .env file81 uses: xom9ikk/dotenv@v1.0.28283 - name: Generate ENV related extend Dockerfile file84 uses: cuchi/jinja2-action@v1.2.085 with:86 template: .docker/Dockerfile-xcm.j287 output_file: .docker/Dockerfile-xcm.${{ matrix.network }}.yml88 variables: |89 RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}90 NETWORK=${{ matrix.network }}91 POLKADOT_BUILD_BRANCH=${{ env.POLKADOT_BUILD_BRANCH }}92 POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}93 FEATURE=${{ matrix.features }}94 RUNTIME=${{ matrix.runtime }}95 BRANCH=${{ github.head_ref }}96 ACALA_BUILD_BRANCH=${{ env.ACALA_BUILD_BRANCH }}97 MOONBEAM_BUILD_BRANCH=${{ env.MOONBEAM_BUILD_BRANCH }}98 CUMULUS_BUILD_BRANCH=${{ env.CUMULUS_BUILD_BRANCH }}99100 - name: Show build Dockerfile101 run: cat .docker/Dockerfile-xcm.${{ matrix.network }}.yml102103 - name: Show launch-config-xcm-${{ matrix.network }} configuration104 run: cat .docker/xcm-config/launch-config-xcm-${{ matrix.network }}.json105106 - name: Run find-and-replace to remove slashes from branch name107 uses: mad9000/actions-find-and-replace-string@2108 id: branchname109 with:110 source: ${{ github.head_ref }}111 find: '/'112 replace: '-'113114 - name: Log in to Docker Hub115 uses: docker/login-action@v2.0.0116 with:117 username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}118 password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}119120 - name: Pull acala docker image121 run: docker pull uniquenetwork/builder-acala:${{ env.ACALA_BUILD_BRANCH }}122123 - name: Pull moonbeam docker image124 run: docker pull uniquenetwork/builder-moonbeam:${{ env.MOONBEAM_BUILD_BRANCH }}125126 - name: Pull cumulus docker image127 run: docker pull uniquenetwork/builder-cumulus:${{ env.CUMULUS_BUILD_BRANCH }}128129 - name: Pull polkadot docker image130 run: docker pull uniquenetwork/builder-polkadot:${{ env.POLKADOT_BUILD_BRANCH }}131132 - name: Pull chainql docker image133 run: docker pull uniquenetwork/builder-chainql:latest134135 - name: Build the stack136 run: cd .docker/ && docker build --no-cache --file ./Dockerfile-xcm.${{ matrix.network }}.yml --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} --tag uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest .137138 - name: Push docker image version139 run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}140141 - name: Push docker image latest142 run: docker push uniquenetwork/xcm-${{ matrix.network }}-testnet-local:latest143144 - name: Clean Workspace145 if: always()146 uses: AutoModality/action-clean@v1.1.0147148 - name: Remove builder cache149 if: always() # run this step always150 run: |151 docker builder prune -f152 docker system prune -f153154155