From 5f417a6c18548a4a4952fa38e63229c9798643bf Mon Sep 17 00:00:00 2001 From: tenequm Date: Thu, 4 Jul 2024 19:39:06 +0100 Subject: [PATCH 1/6] feat: update caching to fix faiiling github action used before --- .github/workflows/docs.yml | 63 +- .github/workflows/reusable-build-and-test.yml | 584 ++++++++++++++---- 2 files changed, 511 insertions(+), 136 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3b64dcf360..abfe65722c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,23 +12,41 @@ jobs: runs-on: [compile-gke] container: image: mangatasolutions/node-builder:multi-nightly-2023-05-22 + env: + JOB_CACHE_PREFIX: node-docs-cache-1 + CACHE_ARCHIVE_NAME: cache_archive.tar.zst steps: - uses: actions/checkout@v4 - uses: google-github-actions/auth@v2 + id: auth with: - workload_identity_provider: '${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}' - service_account: '${{ secrets.GCP_SERVICE_ACCOUNT }}' - - name: Cache the Cargo dependencies - uses: mansagroup/gcs-cache-action@v1.0.3 - with: - bucket: mangata-node-ci-cache - path: | - ${{ github.workspace }}/target - /usr/local/cargo/git - /usr/local/cargo/registry - ~/.cache/sccache - key: node-docs-cache-1-${{ hashFiles('Cargo.lock') }} + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - uses: google-github-actions/setup-gcloud@v2 + + - name: Download cargo build cache + id: cache + run: | + set -x + CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_FOUND=false + + if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then + CACHE_FOUND=true + fi + + echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT + echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT + + - uses: mozilla-actions/sccache-action@v0.0.5 + - run: | + echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV + echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV + echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV - name: Build docs run: cargo doc @@ -40,4 +58,23 @@ jobs: destination: mangata-docs-node parent: false concurrency: 50 - process_gcloudignore: false \ No newline at end of file + process_gcloudignore: false + + - name: Upload cargo build cache + run: | + set -x + CACHE_KEY="${{ steps.cache.outputs.cache_key }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_PATHS=( + "${{ github.workspace }}/target" + "/usr/local/cargo/bin/" + "/usr/local/cargo/registry/index/" + "/usr/local/cargo/registry/cache/" + "/usr/local/cargo/git/db/" + ) + + SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME" + echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)" + + SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" + echo "Upload completed in $SECONDS seconds" \ No newline at end of file diff --git a/.github/workflows/reusable-build-and-test.yml b/.github/workflows/reusable-build-and-test.yml index 891f2a039c..24fa5d915e 100644 --- a/.github/workflows/reusable-build-and-test.yml +++ b/.github/workflows/reusable-build-and-test.yml @@ -22,6 +22,11 @@ on: description: Cache version variable to be used to invalidate cache when needed required: false type: number + cache-enabled: + default: true + description: Enable cargo build cache + required: false + type: boolean permissions: contents: read @@ -37,24 +42,45 @@ jobs: DOCKER_HOST: "unix:///run/docker/docker.sock" volumes: - /run/docker:/run/docker + env: + JOB_CACHE_PREFIX: mangata-node-image-build-job-cache-${{ inputs.cache-version }} + CACHE_ARCHIVE_NAME: cache_archive.tar.zst steps: - - uses: actions/checkout@v3 - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 + id: auth with: - workload_identity_provider: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}" - service_account: "${{ secrets.GCP_SERVICE_ACCOUNT }}" + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - uses: google-github-actions/setup-gcloud@v2 - - name: Cache the Cargo dependencies - uses: mansagroup/gcs-cache-action@v1.0.3 - with: - bucket: mangata-node-ci-cache - path: | - ${{ github.workspace }}/target - /usr/local/cargo/git - /usr/local/cargo/registry - ~/.cache/sccache - key: node-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + - name: Download cargo build cache + if: inputs.cache-enabled + id: cache + run: | + set -x + CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_FOUND=false + + if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then + CACHE_FOUND=true + fi + + echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT + echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT + + - name: Install sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Set Rust caching env vars only on non-release run + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV + echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV + echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV - name: Compile mangata-node code run: cargo build --locked --release --no-default-features --features=mangata-rococo,mangata-kusama @@ -110,9 +136,25 @@ jobs: ./mangata_kusama_runtime-${{ inputs.version }}-fast.compact.compressed.wasm ./mangata_rococo_runtime-${{ inputs.version }}-fast.compact.compressed.wasm - - name: Fix permissions on self-hosted runner - if: always() - run: chown -R 1100:1100 $GITHUB_WORKSPACE + - name: Upload cargo build cache + if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + run: | + set -x + CACHE_KEY="${{ steps.cache.outputs.cache_key }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_PATHS=( + "${{ github.workspace }}/target" + "/usr/local/cargo/bin/" + "/usr/local/cargo/registry/index/" + "/usr/local/cargo/registry/cache/" + "/usr/local/cargo/git/db/" + ) + + SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME" + echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)" + + SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" + echo "Upload completed in $SECONDS seconds" rustfmt-check: name: Formatting check @@ -129,49 +171,136 @@ jobs: runs-on: ubuntu-latest container: image: ${{ inputs.builder_image }} + env: + JOB_CACHE_PREFIX: mangata-node-clippy-job-cache-${{ inputs.cache-version }} + CACHE_ARCHIVE_NAME: cache_archive.tar.zst steps: - - uses: actions/checkout@v3 - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 - with: - workload_identity_provider: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}" - service_account: "${{ secrets.GCP_SERVICE_ACCOUNT }}" - - name: Cache the Cargo dependencies - uses: mansagroup/gcs-cache-action@v1.0.3 + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 + id: auth with: - bucket: mangata-node-ci-cache - path: | - ${{ github.workspace }}/target - /usr/local/cargo/git - /usr/local/cargo/registry - key: cargo-clippy-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - uses: google-github-actions/setup-gcloud@v2 + + - name: Download cargo build cache + if: inputs.cache-enabled + id: cache + run: | + set -x + CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_FOUND=false + + if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then + CACHE_FOUND=true + fi + + echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT + echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT + + - name: Install sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Set Rust caching env vars only on non-release run + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV + echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV + echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV - name: Run clippy run: cargo clippy -p pallet-xyk + - name: Upload cargo build cache + if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + run: | + set -x + CACHE_KEY="${{ steps.cache.outputs.cache_key }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_PATHS=( + "${{ github.workspace }}/target" + "/usr/local/cargo/bin/" + "/usr/local/cargo/registry/index/" + "/usr/local/cargo/registry/cache/" + "/usr/local/cargo/git/db/" + ) + + SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME" + echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)" + + SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" + echo "Upload completed in $SECONDS seconds" + unit-test: name: Unit tests runs-on: [compile-gke] container: image: ${{ inputs.builder_image }} + env: + JOB_CACHE_PREFIX: mangata-node-unit-tests-cache-${{ inputs.cache-version }} + CACHE_ARCHIVE_NAME: cache_archive.tar.zst steps: - - uses: actions/checkout@v3 - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 + id: auth with: - workload_identity_provider: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}" - service_account: "${{ secrets.GCP_SERVICE_ACCOUNT }}" - - name: Cache the Cargo dependencies - uses: mansagroup/gcs-cache-action@v1.0.3 - with: - bucket: mangata-node-ci-cache - path: | - ${{ github.workspace }}/target - /usr/local/cargo/git - /usr/local/cargo/registry - key: cargo-unit-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - uses: google-github-actions/setup-gcloud@v2 + + - name: Download cargo build cache + if: inputs.cache-enabled + id: cache + run: | + set -x + CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_FOUND=false + + if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then + CACHE_FOUND=true + fi + + echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT + echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT + + - name: Install sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Set Rust caching env vars only on non-release run + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV + echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV + echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV + - name: Run unit tests run: cargo test -j2 + - name: Upload cargo build cache + if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + run: | + set -x + CACHE_KEY="${{ steps.cache.outputs.cache_key }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_PATHS=( + "${{ github.workspace }}/target" + "/usr/local/cargo/bin/" + "/usr/local/cargo/registry/index/" + "/usr/local/cargo/registry/cache/" + "/usr/local/cargo/git/db/" + ) + + SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME" + echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)" + + SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" + echo "Upload completed in $SECONDS seconds" + - name: Fix permissions on self-hosted runner if: always() run: chown -R 1100:1100 $GITHUB_WORKSPACE @@ -182,22 +311,46 @@ jobs: container: image: ${{ inputs.builder_image }} options: --security-opt seccomp=unconfined + env: + JOB_CACHE_PREFIX: mangata-node-coverage-job-cache-${{ inputs.cache-version }} + CACHE_ARCHIVE_NAME: cache_archive.tar.zst steps: - - uses: actions/checkout@v3 - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 + id: auth with: - workload_identity_provider: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}" - service_account: "${{ secrets.GCP_SERVICE_ACCOUNT }}" - - name: Cache the Cargo dependencies - uses: mansagroup/gcs-cache-action@v1.0.3 - with: - bucket: mangata-node-ci-cache - path: | - ${{ github.workspace }}/target - /usr/local/cargo/git - /usr/local/cargo/registry - key: cargo-coverage-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - uses: google-github-actions/setup-gcloud@v2 + + - name: Download cargo build cache + if: inputs.cache-enabled + id: cache + run: | + set -x + CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_FOUND=false + + if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then + CACHE_FOUND=true + fi + + echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT + echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT + + - name: Install sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Set Rust caching env vars only on non-release run + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV + echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV + echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV + - name: Install cargo-tarpaulin run: cargo install cargo-tarpaulin@0.26.1 - name: Generate coverage report with cargo-tarpaulin @@ -208,6 +361,26 @@ jobs: token: ${{ secrets.ORG_CODECOV_TOKEN }} fail_ci_if_error: true + - name: Upload cargo build cache + if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + run: | + set -x + CACHE_KEY="${{ steps.cache.outputs.cache_key }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_PATHS=( + "${{ github.workspace }}/target" + "/usr/local/cargo/bin/" + "/usr/local/cargo/registry/index/" + "/usr/local/cargo/registry/cache/" + "/usr/local/cargo/git/db/" + ) + + SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME" + echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)" + + SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" + echo "Upload completed in $SECONDS seconds" + - name: Fix permissions on self-hosted runner if: always() run: chown -R 1100:1100 $GITHUB_WORKSPACE @@ -217,22 +390,45 @@ jobs: runs-on: ubuntu-latest container: image: ${{ inputs.builder_image }} + env: + JOB_CACHE_PREFIX: mangata-node-becnhmark-tests-job-cache-${{ inputs.cache-version }} + CACHE_ARCHIVE_NAME: cache_archive.tar.zst steps: - - uses: actions/checkout@v3 - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 + id: auth with: - workload_identity_provider: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}" - service_account: "${{ secrets.GCP_SERVICE_ACCOUNT }}" - - name: Cache the Cargo dependencies - uses: mansagroup/gcs-cache-action@v1.0.3 - with: - bucket: mangata-node-ci-cache - path: | - ${{ github.workspace }}/target - /usr/local/cargo/git - /usr/local/cargo/registry - key: cargo-benchmark-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - uses: google-github-actions/setup-gcloud@v2 + + - name: Download cargo build cache + if: inputs.cache-enabled + id: cache + run: | + set -x + CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_FOUND=false + + if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then + CACHE_FOUND=true + fi + + echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT + echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT + + - name: Install sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Set Rust caching env vars only on non-release run + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV + echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV + echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV - name: Run benchmarks tests run: cargo test --release -j8 --features=runtime-benchmarks -p pallet-xyk -p pallet-issuance -p pallet-multipurpose-liquidity -p pallet-fee-lock - name: Run benchmarks tests @@ -240,29 +436,71 @@ jobs: # NOTE: MGX-742 - name: Run benchmarks tests run: cargo test --release -j8 --features=runtime-benchmarks -p pallet-proof-of-stake + + - name: Upload cargo build cache + if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + run: | + set -x + CACHE_KEY="${{ steps.cache.outputs.cache_key }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_PATHS=( + "${{ github.workspace }}/target" + "/usr/local/cargo/bin/" + "/usr/local/cargo/registry/index/" + "/usr/local/cargo/registry/cache/" + "/usr/local/cargo/git/db/" + ) + + SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME" + echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)" + + SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" + echo "Upload completed in $SECONDS seconds" build-and-run-try-runtime: name: Run try-runtime checks runs-on: [compile-gke] container: image: ${{ inputs.builder_image }} + env: + JOB_CACHE_PREFIX: mangata-node-try-runtime-job-cache-${{ inputs.cache-version }} + CACHE_ARCHIVE_NAME: cache_archive.tar.zst steps: - - uses: actions/checkout@v3 - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 - with: - workload_identity_provider: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}" - service_account: "${{ secrets.GCP_SERVICE_ACCOUNT }}" - - name: Cache the Cargo dependencies - uses: mansagroup/gcs-cache-action@v1.0.3 + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 + id: auth with: - bucket: mangata-node-ci-cache - path: | - ${{ github.workspace }}/target - /usr/local/cargo/git - /usr/local/cargo/registry - ~/.cache/sccache - key: cargo-try-runtime-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - uses: google-github-actions/setup-gcloud@v2 + + - name: Download cargo build cache + if: inputs.cache-enabled + id: cache + run: | + set -x + CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_FOUND=false + + if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then + CACHE_FOUND=true + fi + + echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT + echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT + + - name: Install sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Set Rust caching env vars only on non-release run + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV + echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV + echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV - name: Build try-runtime Rococo & Kusama node run: cargo build --release --features=try-runtime,mangata-rococo,mangata-kusama @@ -273,6 +511,26 @@ jobs: - name: Run try-runtime Kusama Mainnet run: try-runtime --runtime=target/release/wbuild/mangata-kusama-runtime/mangata_kusama_runtime.wasm on-runtime-upgrade live --uri wss://kusama-rpc.mangata.online:443 + - name: Upload cargo build cache + if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + run: | + set -x + CACHE_KEY="${{ steps.cache.outputs.cache_key }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_PATHS=( + "${{ github.workspace }}/target" + "/usr/local/cargo/bin/" + "/usr/local/cargo/registry/index/" + "/usr/local/cargo/registry/cache/" + "/usr/local/cargo/git/db/" + ) + + SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME" + echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)" + + SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" + echo "Upload completed in $SECONDS seconds" + - name: Fix permissions on self-hosted runner if: always() run: chown -R 1100:1100 $GITHUB_WORKSPACE @@ -281,29 +539,49 @@ jobs: name: Run runtime benchmarks # `performance` self-hosted runners have 8 cores and 16GB of RAM runs-on: [performance-gke] + container: + image: ${{ inputs.builder_image }} env: STEPS: 2 REPEATS: 1 - container: - image: ${{ inputs.builder_image }} + JOB_CACHE_PREFIX: mangata-node-run-benchmarks-job-cache-${{ inputs.cache-version }} + CACHE_ARCHIVE_NAME: cache_archive.tar.zst steps: - - uses: actions/checkout@v3 - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 + id: auth with: - workload_identity_provider: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}" - service_account: "${{ secrets.GCP_SERVICE_ACCOUNT }}" + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - uses: google-github-actions/setup-gcloud@v2 - - name: Cache the Cargo dependencies - uses: mansagroup/gcs-cache-action@v1.0.3 - with: - bucket: mangata-node-ci-cache - path: | - ${{ github.workspace }}/target - /usr/local/cargo/git - /usr/local/cargo/registry - ~/.cache/sccache - key: runtime-benchmark-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + - name: Download cargo build cache + if: inputs.cache-enabled + id: cache + run: | + set -x + CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_FOUND=false + + if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then + CACHE_FOUND=true + fi + + echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT + echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT + + - name: Install sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Set Rust caching env vars only on non-release run + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV + echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV + echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV - name: Compile mangata-node code run: cargo build --release --no-default-features --features=mangata-rococo,mangata-kusama,runtime-benchmarks @@ -340,6 +618,26 @@ jobs: name: benchmarks path: ./benchmarks + - name: Upload cargo build cache + if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + run: | + set -x + CACHE_KEY="${{ steps.cache.outputs.cache_key }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_PATHS=( + "${{ github.workspace }}/target" + "/usr/local/cargo/bin/" + "/usr/local/cargo/registry/index/" + "/usr/local/cargo/registry/cache/" + "/usr/local/cargo/git/db/" + ) + + SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME" + echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)" + + SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" + echo "Upload completed in $SECONDS seconds" + - name: Fix permissions on self-hosted runner if: always() run: chown -R 1100:1100 $GITHUB_WORKSPACE @@ -347,29 +645,49 @@ jobs: build-wasms: name: Export wasm artifacts runs-on: [compile-gke] + container: + image: ${{ inputs.builder_image }} env: STEPS: 2 REPEATS: 1 - container: - image: ${{ inputs.builder_image }} + JOB_CACHE_PREFIX: mangata-node-build-wasms-job-cache-${{ inputs.cache-version }} + CACHE_ARCHIVE_NAME: cache_archive.tar.zst steps: - - uses: actions/checkout@v3 - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 + - uses: actions/checkout@v4 + - uses: google-github-actions/auth@v2 + id: auth with: - workload_identity_provider: "${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}" - service_account: "${{ secrets.GCP_SERVICE_ACCOUNT }}" + workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - uses: google-github-actions/setup-gcloud@v2 - - name: Cache the Cargo dependencies - uses: mansagroup/gcs-cache-action@v1.0.3 - with: - bucket: mangata-node-ci-cache - path: | - ${{ github.workspace }}/target - /usr/local/cargo/git - /usr/local/cargo/registry - ~/.cache/sccache - key: build-wasms-cache-${{ inputs.cache_version }}-${{ hashFiles('Cargo.lock') }} + - name: Download cargo build cache + if: inputs.cache-enabled + id: cache + run: | + set -x + CACHE_KEY="${{ env.JOB_CACHE_PREFIX }}-${{ hashFiles('**/Cargo.lock') }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_FOUND=false + + if gcloud storage cp "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" - | zstd -d | tar -xf - -C / ; then + CACHE_FOUND=true + fi + + echo "cache_found=$CACHE_FOUND" >> $GITHUB_OUTPUT + echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT + + - name: Install sccache-cache only on non-release runs + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Set Rust caching env vars only on non-release run + if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' + run: | + echo "SCCACHE_GCS_BUCKET=mangata-node-ci-cache" >> $GITHUB_ENV + echo "SCCACHE_GCS_RW_MODE=READ_WRITE" >> $GITHUB_ENV + echo "SCCACHE_GCS_KEY_PREFIX=${{ env.JOB_CACHE_PREFIX }}" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV - name: Compile mangata-node code run: cargo build --release --no-default-features --features=mangata-rococo,mangata-kusama,runtime-benchmarks @@ -385,6 +703,26 @@ jobs: /bin/bash -c 'target/release/mangata-node export-genesis-state --chain=mangata-rococo-local -l=info,xyk=error > /dev/null' /bin/bash -c 'target/release/mangata-node export-genesis-wasm --chain=mangata-rococo-local -l=info,xyk=error > /dev/null' + - name: Upload cargo build cache + if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + run: | + set -x + CACHE_KEY="${{ steps.cache.outputs.cache_key }}" + ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" + CACHE_PATHS=( + "${{ github.workspace }}/target" + "/usr/local/cargo/bin/" + "/usr/local/cargo/registry/index/" + "/usr/local/cargo/registry/cache/" + "/usr/local/cargo/git/db/" + ) + + SECONDS=0; tar -cf - "${CACHE_PATHS[@]}" | zstd -T0 -5 > "$ARCHIVE_NAME" + echo "Compression completed in $SECONDS seconds" && echo "Archive size: $(du -h "$ARCHIVE_NAME" | cut -f1)" + + SECONDS=0; gcloud storage cp "$ARCHIVE_NAME" "gs://mangata-node-ci-cache/$CACHE_KEY/$ARCHIVE_NAME" + echo "Upload completed in $SECONDS seconds" + - name: Fix permissions on self-hosted runner if: always() run: chown -R 1100:1100 $GITHUB_WORKSPACE From ffaad53e2589b46045c12f8aca06d3d3277913af Mon Sep 17 00:00:00 2001 From: tenequm Date: Thu, 4 Jul 2024 20:02:04 +0100 Subject: [PATCH 2/6] fix: upload cache script --- .github/workflows/docs.yml | 1 + .github/workflows/reusable-build-and-test.yml | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index abfe65722c..b084c92bef 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -61,6 +61,7 @@ jobs: process_gcloudignore: false - name: Upload cargo build cache + shell: bash run: | set -x CACHE_KEY="${{ steps.cache.outputs.cache_key }}" diff --git a/.github/workflows/reusable-build-and-test.yml b/.github/workflows/reusable-build-and-test.yml index 24fa5d915e..290e20828a 100644 --- a/.github/workflows/reusable-build-and-test.yml +++ b/.github/workflows/reusable-build-and-test.yml @@ -138,6 +138,7 @@ jobs: - name: Upload cargo build cache if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + shell: bash run: | set -x CACHE_KEY="${{ steps.cache.outputs.cache_key }}" @@ -215,6 +216,7 @@ jobs: - name: Upload cargo build cache if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + shell: bash run: | set -x CACHE_KEY="${{ steps.cache.outputs.cache_key }}" @@ -283,6 +285,7 @@ jobs: - name: Upload cargo build cache if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + shell: bash run: | set -x CACHE_KEY="${{ steps.cache.outputs.cache_key }}" @@ -363,6 +366,7 @@ jobs: - name: Upload cargo build cache if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + shell: bash run: | set -x CACHE_KEY="${{ steps.cache.outputs.cache_key }}" @@ -439,6 +443,7 @@ jobs: - name: Upload cargo build cache if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + shell: bash run: | set -x CACHE_KEY="${{ steps.cache.outputs.cache_key }}" @@ -513,6 +518,7 @@ jobs: - name: Upload cargo build cache if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + shell: bash run: | set -x CACHE_KEY="${{ steps.cache.outputs.cache_key }}" @@ -620,6 +626,7 @@ jobs: - name: Upload cargo build cache if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + shell: bash run: | set -x CACHE_KEY="${{ steps.cache.outputs.cache_key }}" @@ -705,6 +712,7 @@ jobs: - name: Upload cargo build cache if: inputs.cache-enabled && steps.cache.outputs.cache_found == 'false' + shell: bash run: | set -x CACHE_KEY="${{ steps.cache.outputs.cache_key }}" From 1e7fa9ab83815952c097b04dc22297b4e1430ef2 Mon Sep 17 00:00:00 2001 From: tenequm Date: Thu, 4 Jul 2024 20:16:48 +0100 Subject: [PATCH 3/6] fix: target path --- .github/workflows/docs.yml | 2 +- .github/workflows/reusable-build-and-test.yml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b084c92bef..636694a46a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -67,7 +67,7 @@ jobs: CACHE_KEY="${{ steps.cache.outputs.cache_key }}" ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" CACHE_PATHS=( - "${{ github.workspace }}/target" + "./target" "/usr/local/cargo/bin/" "/usr/local/cargo/registry/index/" "/usr/local/cargo/registry/cache/" diff --git a/.github/workflows/reusable-build-and-test.yml b/.github/workflows/reusable-build-and-test.yml index 290e20828a..d465253c3a 100644 --- a/.github/workflows/reusable-build-and-test.yml +++ b/.github/workflows/reusable-build-and-test.yml @@ -144,7 +144,7 @@ jobs: CACHE_KEY="${{ steps.cache.outputs.cache_key }}" ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" CACHE_PATHS=( - "${{ github.workspace }}/target" + "./target" "/usr/local/cargo/bin/" "/usr/local/cargo/registry/index/" "/usr/local/cargo/registry/cache/" @@ -222,7 +222,7 @@ jobs: CACHE_KEY="${{ steps.cache.outputs.cache_key }}" ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" CACHE_PATHS=( - "${{ github.workspace }}/target" + "./target" "/usr/local/cargo/bin/" "/usr/local/cargo/registry/index/" "/usr/local/cargo/registry/cache/" @@ -291,7 +291,7 @@ jobs: CACHE_KEY="${{ steps.cache.outputs.cache_key }}" ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" CACHE_PATHS=( - "${{ github.workspace }}/target" + "./target" "/usr/local/cargo/bin/" "/usr/local/cargo/registry/index/" "/usr/local/cargo/registry/cache/" @@ -372,7 +372,7 @@ jobs: CACHE_KEY="${{ steps.cache.outputs.cache_key }}" ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" CACHE_PATHS=( - "${{ github.workspace }}/target" + "./target" "/usr/local/cargo/bin/" "/usr/local/cargo/registry/index/" "/usr/local/cargo/registry/cache/" @@ -449,7 +449,7 @@ jobs: CACHE_KEY="${{ steps.cache.outputs.cache_key }}" ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" CACHE_PATHS=( - "${{ github.workspace }}/target" + "./target" "/usr/local/cargo/bin/" "/usr/local/cargo/registry/index/" "/usr/local/cargo/registry/cache/" @@ -524,7 +524,7 @@ jobs: CACHE_KEY="${{ steps.cache.outputs.cache_key }}" ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" CACHE_PATHS=( - "${{ github.workspace }}/target" + "./target" "/usr/local/cargo/bin/" "/usr/local/cargo/registry/index/" "/usr/local/cargo/registry/cache/" @@ -632,7 +632,7 @@ jobs: CACHE_KEY="${{ steps.cache.outputs.cache_key }}" ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" CACHE_PATHS=( - "${{ github.workspace }}/target" + "./target" "/usr/local/cargo/bin/" "/usr/local/cargo/registry/index/" "/usr/local/cargo/registry/cache/" @@ -718,7 +718,7 @@ jobs: CACHE_KEY="${{ steps.cache.outputs.cache_key }}" ARCHIVE_NAME="${{ env.CACHE_ARCHIVE_NAME }}" CACHE_PATHS=( - "${{ github.workspace }}/target" + "./target" "/usr/local/cargo/bin/" "/usr/local/cargo/registry/index/" "/usr/local/cargo/registry/cache/" From 8d0aabd51668208ca06a78979f695af2d67b5eb6 Mon Sep 17 00:00:00 2001 From: tenequm Date: Thu, 4 Jul 2024 20:23:48 +0100 Subject: [PATCH 4/6] fix: issue with cargo-tarpaulin installation --- .github/workflows/reusable-build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build-and-test.yml b/.github/workflows/reusable-build-and-test.yml index d465253c3a..6cb2f628a4 100644 --- a/.github/workflows/reusable-build-and-test.yml +++ b/.github/workflows/reusable-build-and-test.yml @@ -355,7 +355,7 @@ jobs: echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV - name: Install cargo-tarpaulin - run: cargo install cargo-tarpaulin@0.26.1 + run: cargo install cargo-tarpaulin@0.26.1 --locked - name: Generate coverage report with cargo-tarpaulin run: cargo tarpaulin --timeout 120 --workspace -e runtime-integration-test mangata-node common-runtime mangata-kusama-runtime mangata-rococo-runtime --exclude-files **/mock.rs **/weights.rs **/weights/* --out Xml - name: Upload to codecov.io From d90f3d5f0ed209d3ae0966ff790edbbe13b2d42b Mon Sep 17 00:00:00 2001 From: goncer Date: Fri, 5 Jul 2024 14:19:46 +0200 Subject: [PATCH 5/6] update secrets for develop vertical --- .github/workflows/reusable-e2e-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-e2e-tests.yml b/.github/workflows/reusable-e2e-tests.yml index 546037e10e..6c1cbfb62a 100644 --- a/.github/workflows/reusable-e2e-tests.yml +++ b/.github/workflows/reusable-e2e-tests.yml @@ -134,10 +134,10 @@ jobs: timeout-minutes: 180 env: API_URL: "ws://127.0.0.1:9946" - TEST_PALLET_ADDRESS: ${{ secrets.E2E_TEST_PALLET_ADDRESS }} - E2E_TREASURY_PALLET_ADDRESS: ${{ secrets.E2E_TREASURY_PALLET_ADDRESS }} - E2E_XYK_PALLET_ADDRESS: ${{ secrets.E2E_XYK_PALLET_ADDRESS }} - E2E_TREASURY_BURN_PALLET_ADDRESS: ${{ secrets.E2E_TREASURY_BURN_PALLET_ADDRESS }} + TEST_PALLET_ADDRESS: ${{ secrets.MGX_TEST_PALLET_ADDRESS }} + E2E_TREASURY_PALLET_ADDRESS: ${{ secrets.MGX_E2E_TREASURY_PALLET_ADDRESS }} + E2E_XYK_PALLET_ADDRESS: ${{ secrets.MGX_E2E_XYK_PALLET_ADDRESS }} + E2E_TREASURY_BURN_PALLET_ADDRESS: ${{ secrets.MGX_E2E_TREASURY_BURN_PALLET_ADDRESS }} TEST_SUDO_NAME: "//Alice" MANGATA_NODE_VERSION: ${{ inputs.globalVersion }} E2EBRANCHNAME: "main" From 7971fc89bb3369e846d4933f9657b1482472a65e Mon Sep 17 00:00:00 2001 From: tenequm Date: Fri, 5 Jul 2024 16:23:39 +0100 Subject: [PATCH 6/6] fix: cargo-tarpaulin installation if it already is installed --- .github/workflows/reusable-build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build-and-test.yml b/.github/workflows/reusable-build-and-test.yml index 6cb2f628a4..720d5b5a35 100644 --- a/.github/workflows/reusable-build-and-test.yml +++ b/.github/workflows/reusable-build-and-test.yml @@ -355,7 +355,7 @@ jobs: echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV - name: Install cargo-tarpaulin - run: cargo install cargo-tarpaulin@0.26.1 --locked + run: which cargo-tarpaulin || cargo install cargo-tarpaulin@0.26.1 --locked - name: Generate coverage report with cargo-tarpaulin run: cargo tarpaulin --timeout 120 --workspace -e runtime-integration-test mangata-node common-runtime mangata-kusama-runtime mangata-rococo-runtime --exclude-files **/mock.rs **/weights.rs **/weights/* --out Xml - name: Upload to codecov.io