From c7bea501f843a96be7a5a1279cbe4ee6ceed906f Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 13 Apr 2023 16:02:47 +0800 Subject: [PATCH 01/27] ci: cache for WASM DPP integration --- .github/workflows/all-packages.yml | 121 +++-- .github/workflows/js-checks.yml | 65 ++- .github/workflows/release.yml | 421 +++++++++++------- .github/workflows/rs-checks.yml | 57 ++- .github/workflows/rs-drive.yml | 19 +- .github/workflows/wasm-dpp.yml | 19 +- packages/dapi/Dockerfile | 4 +- packages/dashmate/Dockerfile | 4 +- packages/dashmate/src/docker/DockerCompose.js | 2 + .../listr/tasks/buildServicesTaskFactory.js | 14 +- packages/js-drive/Dockerfile | 6 +- packages/platform-test-suite/Dockerfile | 4 +- 12 files changed, 465 insertions(+), 271 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 47962f1b3ce..64801f5eb86 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -66,6 +66,9 @@ jobs: name: Run Platform Test Suite runs-on: ubuntu-22.04 timeout-minutes: 60 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -81,27 +84,18 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.3 + - name: Setup Cargo cache + uses: Swatinem/rust-cache@v2 with: - version: "v0.4.1" - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo - - name: Configure sccache - uses: actions/github-script@v6 + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - - name: Run sccache stat for check - shell: bash - run: ${SCCACHE_PATH} --show-stats - - # - name: Enable Rust cache - # uses: Swatinem/rust-cache@v2 + version: "v0.4.1" - name: Enable corepack run: corepack enable @@ -123,28 +117,12 @@ jobs: - name: Build SDK run: yarn build --filter "+dash" + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats + - name: Set up Docker BuildX - id: buildx - uses: docker/setup-buildx-action@v2.5.0 - with: - version: v0.10.4 - install: true - driver-opts: image=moby/buildkit:buildx-stable-1 - - # - name: Enable buildkit cache - # uses: actions/cache@v3 - # with: - # path: /tmp/buildkit-cache/buildkit-state.tar - # key: ${{ runner.os }}-buildkit-${{ github.sha }} - # restore-keys: | - # ${{ runner.os }}-buildkit- - - # - name: Load buildkit state from cache - # uses: dashevo/gh-action-cache-buildkit-state@skip-cachemount - # with: - # builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 - # cache-path: /tmp/buildkit-cache - # cache-max-size: 6gb + uses: docker/setup-buildx-action@v2 - name: Setup local network run: yarn configure @@ -163,6 +141,9 @@ jobs: name: Run Platform Test Suite in Browsers runs-on: ubuntu-22.04 timeout-minutes: 60 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -178,8 +159,18 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Enable Rust cache + - name: Setup Cargo cache uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - name: Enable corepack run: corepack enable @@ -201,28 +192,12 @@ jobs: - name: Build SDK run: yarn build --filter "+dash" + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats + - name: Set up Docker BuildX - id: buildx uses: docker/setup-buildx-action@v2 - with: - version: v0.9.1 - install: true - driver-opts: image=moby/buildkit:buildx-stable-1 - - - name: Enable buildkit cache - uses: actions/cache@v3 - with: - path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildkit- - - - name: Load buildkit state from cache - uses: dashevo/gh-action-cache-buildkit-state@skip-cachemount - with: - builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 - cache-path: /tmp/buildkit-cache - cache-max-size: 6gb - name: Setup local network run: yarn configure @@ -264,10 +239,19 @@ jobs: with: toolchain: stable target: wasm32-unknown-unknown - components: clippy - - name: Setup wasm-bindgen - run: cargo install -f wasm-bindgen-cli + - name: Setup Cargo cache + uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - name: Enable corepack run: corepack enable @@ -287,14 +271,11 @@ jobs: run: yarn install - name: Build package and dependencies - run: yarn build --filter "+${{ inputs.package }}" - if: ${{ !inputs.start-local-network }} + run: yarn build --filter "+dash" - - name: Build all packages - run: yarn build - if: ${{ inputs.start-local-network }} + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 - with: - category: "/language:javascript" diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index 76c685fe8fb..58c75fbe44f 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -28,6 +28,9 @@ jobs: name: Linting runs-on: ubuntu-22.04 timeout-minutes: 20 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -43,8 +46,18 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Enable Rust cache + - name: Setup Cargo cache uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - name: Enable corepack run: corepack enable @@ -66,6 +79,10 @@ jobs: - name: Build package and dependencies run: yarn build --filter "+${{ inputs.package }}" + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats + - name: Run ESLinter run: yarn workspace "${{ inputs.package }}" lint @@ -74,6 +91,9 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 60 if: ${{ !inputs.skip-tests }} + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Setup Firefox uses: browser-actions/setup-firefox@latest @@ -95,8 +115,18 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Enable Rust cache + - name: Setup Cargo cache uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - name: Enable corepack run: corepack enable @@ -120,10 +150,19 @@ jobs: env: NODE_ENV: test + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats + + # TODO: We build second time here, but with cache it must be quick - name: Build SDK run: yarn build --filter "+dash" if: ${{ inputs.start-local-network }} + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats + - name: Create necessary dotenv files run: | cp packages/dapi/.env.example packages/dapi/.env @@ -131,29 +170,7 @@ jobs: if: ${{ !inputs.start-local-network }} - name: Set up Docker BuildX - id: buildx uses: docker/setup-buildx-action@v2 - with: - version: v0.9.1 - install: true - driver-opts: image=moby/buildkit:buildx-stable-1 - if: ${{ inputs.start-local-network }} - - - name: Enable buildkit cache - uses: actions/cache@v3 - with: - path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildkit- - if: ${{ inputs.start-local-network }} - - - name: Load buildkit state from cache - uses: dashevo/gh-action-cache-buildkit-state@v1 - with: - builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 - cache-path: /tmp/buildkit-cache - cache-max-size: 3g if: ${{ inputs.start-local-network }} - name: Setup local network diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 95ccab5509a..5b933a8699a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,9 @@ jobs: if: github.event_name != 'workflow_dispatch' needs: - build-rs-drive-nodejs + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -36,8 +39,18 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Enable Rust cache + - name: Setup Cargo cache uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - name: Setup Node.JS uses: actions/setup-node@v3 @@ -66,6 +79,10 @@ jobs: env: CARGO_BUILD_PROFILE: release + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats + - name: Download prebuild artifacts uses: actions/download-artifact@v3 with: @@ -106,47 +123,58 @@ jobs: release-drive-docker-image: name: Release Drive to Docker Hub runs-on: ubuntu-22.04 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 - - name: Setup Node.JS - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Enable corepack - run: corepack enable - - - name: Disable NPM audit - run: npm config set audit false - - - name: Enable Yarn unplugged modules cache - uses: actions/cache@v3 - with: - path: '.yarn/unplugged' - key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn-unplugged- - - - name: Install dependencies - run: yarn install - - - name: Build packages - run: yarn build --filter "+@dashevo/drive" + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" +# +# - name: Setup Node.JS +# uses: actions/setup-node@v3 +# with: +# node-version: '16' +# +# - name: Enable corepack +# run: corepack enable +# +# - name: Disable NPM audit +# run: npm config set audit false +# +# - name: Enable Yarn unplugged modules cache +# uses: actions/cache@v3 +# with: +# path: '.yarn/unplugged' +# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} +# restore-keys: | +# ${{ runner.os }}-yarn-unplugged- +# +# - name: Install dependencies +# run: yarn install +# +# - name: Build packages +# run: yarn build --filter "+@dashevo/drive" +# env: +# CARGO_BUILD_PROFILE: release +# +# - name: Show Rust compilation cache stats +# shell: bash +# run: ${SCCACHE_PATH} --show-stats - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 - name: Set up Docker BuildX - id: buildx uses: docker/setup-buildx-action@v2 with: - version: v0.9.1 install: true - driver-opts: image=moby/buildkit:buildx-stable-1 - - name: Enable buildkit cache + - name: Enable docker cache mount uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar @@ -154,7 +182,7 @@ jobs: restore-keys: | ${{ runner.os }}-buildkit- - - name: Load buildkit state from cache + - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 with: builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 @@ -212,39 +240,62 @@ jobs: push: true tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} + build-args: | + SCCACHE_GHA_ENABLED=true + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + CARGO_BUILD_PROFILE=release platforms: linux/amd64,linux/arm64 + cache-from: | + type=gha + # In practice, time spent preparing images is much lower than build. + # We minimize cached info to leave more space for sccache cache. + cache-to: | + type=gha,mode=min release-dapi-docker-image: name: Release DAPI to Docker Hub runs-on: ubuntu-22.04 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 - - name: Setup Node.JS - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Enable corepack - run: corepack enable - - - name: Disable NPM audit - run: npm config set audit false - - - name: Enable Yarn unplugged modules cache - uses: actions/cache@v3 - with: - path: '.yarn/unplugged' - key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn-unplugged- - - - name: Install dependencies - run: yarn install - - - name: Build packages - run: yarn build --filter "+@dashevo/dapi" + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" +# +# - name: Setup Node.JS +# uses: actions/setup-node@v3 +# with: +# node-version: '16' +# +# - name: Enable corepack +# run: corepack enable +# +# - name: Disable NPM audit +# run: npm config set audit false +# +# - name: Enable Yarn unplugged modules cache +# uses: actions/cache@v3 +# with: +# path: '.yarn/unplugged' +# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} +# restore-keys: | +# ${{ runner.os }}-yarn-unplugged- +# +# - name: Install dependencies +# run: yarn install +# +# - name: Build packages +# run: yarn build --filter "+@dashevo/dapi" +# +# - name: Show Rust compilation cache stats +# shell: bash +# run: ${SCCACHE_PATH} --show-stats - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -253,9 +304,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 with: - version: v0.9.1 install: true - driver-opts: image=moby/buildkit:buildx-stable-1 - name: Enable buildkit cache uses: actions/cache@v3 @@ -324,38 +373,61 @@ jobs: tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} platforms: linux/amd64,linux/arm64 + build-args: | + SCCACHE_GHA_ENABLED=true + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + CARGO_BUILD_PROFILE=release + cache-from: | + type=gha + # In practice, time spent preparing images is much lower than build. + # We minimize cached info to leave more space for sccache cache. + cache-to: | + type=gha,mode=min release-test-suite-docker-image: name: Release Test Suite to Docker Hub runs-on: ubuntu-22.04 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 - - name: Setup Node.JS - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Enable corepack - run: corepack enable - - - name: Disable NPM audit - run: npm config set audit false - - - name: Enable Yarn unplugged modules cache - uses: actions/cache@v3 - with: - path: '.yarn/unplugged' - key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn-unplugged- - - - name: Install dependencies - run: yarn install - - - name: Build packages - run: yarn build --filter "+@dashevo/platform-test-suite" + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" +# +# - name: Setup Node.JS +# uses: actions/setup-node@v3 +# with: +# node-version: '16' +# +# - name: Enable corepack +# run: corepack enable +# +# - name: Disable NPM audit +# run: npm config set audit false +# +# - name: Enable Yarn unplugged modules cache +# uses: actions/cache@v3 +# with: +# path: '.yarn/unplugged' +# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} +# restore-keys: | +# ${{ runner.os }}-yarn-unplugged- +# +# - name: Install dependencies +# run: yarn install +# +# - name: Build packages +# run: yarn build --filter "+@dashevo/platform-test-suite" +# +# - name: Show Rust compilation cache stats +# shell: bash +# run: ${SCCACHE_PATH} --show-stats - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -364,9 +436,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 with: - version: v0.9.1 install: true - driver-opts: image=moby/buildkit:buildx-stable-1 - name: Enable buildkit cache uses: actions/cache@v3 @@ -435,6 +505,17 @@ jobs: tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} platforms: linux/amd64,linux/arm64 + build-args: | + SCCACHE_GHA_ENABLED=true + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + CARGO_BUILD_PROFILE=release + cache-from: | + type=gha + # In practice, time spent preparing images is much lower than build. + # We minimize cached info to leave more space for sccache cache. + cache-to: | + type=gha,mode=min release-envoy-docker-image: name: Release Envoy to Docker Hub @@ -450,24 +531,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 with: - version: v0.9.1 install: true - driver-opts: image=moby/buildkit:buildx-stable-1 - - - name: Enable buildkit cache - uses: actions/cache@v3 - with: - path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildkit- - - - name: Load buildkit state from cache - uses: dashevo/gh-action-cache-buildkit-state@v1 - with: - builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 - cache-path: /tmp/buildkit-cache - cache-max-size: 3g - name: Login to DockerHub uses: docker/login-action@v2 @@ -521,40 +585,46 @@ jobs: tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} platforms: linux/amd64,linux/arm64 - build-args: | - CARGO_BUILD_PROFILE=release release-dashmate-helper-docker-image: name: Release Dashmate helper to Docker Hub runs-on: ubuntu-22.04 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 - - name: Setup Node.JS - uses: actions/setup-node@v3 - with: - node-version: '16' - - - name: Enable corepack - run: corepack enable - - - name: Disable NPM audit - run: npm config set audit false - - - name: Enable Yarn unplugged modules cache - uses: actions/cache@v3 - with: - path: '.yarn/unplugged' - key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn-unplugged- - - - name: Install dependencies - run: yarn install - - - name: Build packages - run: yarn build --filter "+dashmate" + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" +# +# - name: Setup Node.JS +# uses: actions/setup-node@v3 +# with: +# node-version: '16' +# +# - name: Enable corepack +# run: corepack enable +# +# - name: Disable NPM audit +# run: npm config set audit false +# +# - name: Enable Yarn unplugged modules cache +# uses: actions/cache@v3 +# with: +# path: '.yarn/unplugged' +# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} +# restore-keys: | +# ${{ runner.os }}-yarn-unplugged- +# +# - name: Install dependencies +# run: yarn install +# +# - name: Build packages +# run: yarn build --filter "+dashmate" - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -563,9 +633,7 @@ jobs: id: buildx uses: docker/setup-buildx-action@v2 with: - version: v0.9.1 install: true - driver-opts: image=moby/buildkit:buildx-stable-1 - name: Enable buildkit cache uses: actions/cache@v3 @@ -634,7 +702,19 @@ jobs: tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} platforms: linux/amd64,linux/arm64 - + build-args: | + SCCACHE_GHA_ENABLED=true + ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} + ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} + CARGO_BUILD_PROFILE=release + cache-from: | + type=gha + # In practice, time spent preparing images is much lower than build. + # We minimize cached info to leave more space for sccache cache. + cache-to: | + type=gha,mode=min + + # TODO: Implement yarn and rust cache build-rs-drive-nodejs: name: Build Drive Node.JS binding strategy: @@ -670,6 +750,9 @@ jobs: platform: apple-darwin runs-on: ${{ matrix.os }} + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -719,8 +802,10 @@ jobs: toolchain: stable target: ${{ steps.set-target.outputs.result }} - - name: Enable Rust cache - uses: Swatinem/rust-cache@v2 + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - name: Set LIBC argument uses: actions/github-script@v6 @@ -784,15 +869,13 @@ jobs: os: ubuntu-22.04 - package_type: macos os: macos-12 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 - - name: Setup Node.JS - uses: actions/setup-node@v3 - with: - node-version: '16' - - name: Install macOS build deps if: runner.os == 'macOS' run: | @@ -826,33 +909,47 @@ jobs: - name: Install Linux build deps if: runner.os == 'Linux' run: sudo apt-get install -y nsis - - - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - target: wasm32-unknown-unknown - - - name: Enable corepack - run: corepack enable - - - name: Disable NPM audit - run: npm config set audit false - - - name: Enable Yarn unplugged modules cache - uses: actions/cache@v3 - with: - path: '.yarn/unplugged' - key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn-unplugged- - - - name: Install dependencies - run: yarn install - - - name: Build packages - run: yarn build - env: - CARGO_BUILD_PROFILE: release +# +# - name: Setup Node.JS +# uses: actions/setup-node@v3 +# with: +# node-version: '16' +# +# - uses: dtolnay/rust-toolchain@master +# with: +# toolchain: stable +# target: wasm32-unknown-unknown +# +# - name: Setup Rust compilation cache +# uses: mozilla-actions/sccache-action@v0.0.3 +# with: +# version: "v0.4.1" +# +# - name: Enable corepack +# run: corepack enable +# +# - name: Disable NPM audit +# run: npm config set audit false +# +# - name: Enable Yarn unplugged modules cache +# uses: actions/cache@v3 +# with: +# path: '.yarn/unplugged' +# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} +# restore-keys: | +# ${{ runner.os }}-yarn-unplugged- +# +# - name: Install dependencies +# run: yarn install +# +# - name: Build packages +# run: yarn build +# env: +# CARGO_BUILD_PROFILE: release +# +# - name: Show Rust compilation cache stats +# shell: bash +# run: ${SCCACHE_PATH} --show-stats - name: Create package env: diff --git a/.github/workflows/rs-checks.yml b/.github/workflows/rs-checks.yml index 50e379f7729..f0d2bdaba7c 100644 --- a/.github/workflows/rs-checks.yml +++ b/.github/workflows/rs-checks.yml @@ -13,6 +13,9 @@ jobs: name: Linting runs-on: ubuntu-22.04 timeout-minutes: 20 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -23,14 +26,28 @@ jobs: toolchain: stable components: clippy - - name: Enable Rust cache + - name: Setup Cargo cache uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats + formatting: name: Formatting runs-on: ubuntu-22.04 @@ -51,6 +68,9 @@ jobs: name: Compilation errors runs-on: ubuntu-22.04 timeout-minutes: 20 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -61,15 +81,32 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Enable Rust cache + - name: Setup Cargo cache uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - run: cargo check --package=${{ inputs.package }} + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats + test: name: Tests runs-on: ubuntu-22.04 timeout-minutes: 20 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -80,8 +117,22 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Enable Rust cache + - name: Setup Cargo cache uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - name: Run tests run: cargo test --package=${{ inputs.package }} --all-features + + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats diff --git a/.github/workflows/rs-drive.yml b/.github/workflows/rs-drive.yml index a973f586e80..bf7bdd7e958 100644 --- a/.github/workflows/rs-drive.yml +++ b/.github/workflows/rs-drive.yml @@ -26,6 +26,9 @@ jobs: name: Feature compilation errors runs-on: ubuntu-22.04 timeout-minutes: 20 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -36,11 +39,25 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Enable Rust Cache + - name: Setup Cargo cache uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - run: cargo check --package=drive --no-default-features --features=verify + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats + rs-checks: name: Rust uses: ./.github/workflows/rs-checks.yml diff --git a/.github/workflows/wasm-dpp.yml b/.github/workflows/wasm-dpp.yml index ef343d819a4..d6d5909464d 100644 --- a/.github/workflows/wasm-dpp.yml +++ b/.github/workflows/wasm-dpp.yml @@ -41,6 +41,9 @@ jobs: wasm-errors: name: WASM compilation runs-on: ubuntu-22.04 + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" steps: - name: Check out repo uses: actions/checkout@v3 @@ -51,8 +54,22 @@ jobs: toolchain: stable target: wasm32-unknown-unknown - - name: Enable Rust cache + - name: Setup Cargo cache uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" - name: Compile WASM run: cargo check --lib --target wasm32-unknown-unknown --package=wasm-dpp + + - name: Show Rust compilation cache stats + shell: bash + run: ${SCCACHE_PATH} --show-stats diff --git a/packages/dapi/Dockerfile b/packages/dapi/Dockerfile index c519569131d..b8b83ef87ba 100644 --- a/packages/dapi/Dockerfile +++ b/packages/dapi/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.5 -FROM strophy/buildbase:0.0.4 as builder +FROM strophy/buildbase:0.0.5 as builder WORKDIR /platform @@ -29,7 +29,7 @@ COPY packages/masternode-reward-shares-contract packages/masternode-reward-share COPY packages/feature-flags-contract packages/feature-flags-contract # Build WASM DPP -RUN --mount=type=cache,sharing=shared,target=/root/.cache/sccache \ +RUN --mount=type=cache,sharing=private,target=/root/.cache/sccache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \ diff --git a/packages/dashmate/Dockerfile b/packages/dashmate/Dockerfile index 19f7ede63a4..50c6c0a5b95 100644 --- a/packages/dashmate/Dockerfile +++ b/packages/dashmate/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.5 -FROM strophy/buildbase:0.0.4 as builder +FROM strophy/buildbase:0.0.5 as builder WORKDIR /platform @@ -33,7 +33,7 @@ COPY packages/rs-dpp packages/rs-dpp COPY packages/wasm-dpp packages/wasm-dpp # Build WASM DPP -RUN --mount=type=cache,sharing=shared,target=/root/.cache/sccache \ +RUN --mount=type=cache,sharing=private,target=/root/.cache/sccache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \ diff --git a/packages/dashmate/src/docker/DockerCompose.js b/packages/dashmate/src/docker/DockerCompose.js index a7d7438913a..cd4bfec98e3 100644 --- a/packages/dashmate/src/docker/DockerCompose.js +++ b/packages/dashmate/src/docker/DockerCompose.js @@ -122,6 +122,7 @@ class DockerCompose { * * @param {Object} envs * @param {string} [serviceName] + * @param {Array} [options] * @return {Observable<{string}>} */ // eslint-disable-next-line no-unused-vars @@ -144,6 +145,7 @@ class DockerCompose { await dockerCompose.buildAll({ ...this.getOptions(envs), callback, + commandOptions: options, }); } diff --git a/packages/dashmate/src/listr/tasks/buildServicesTaskFactory.js b/packages/dashmate/src/listr/tasks/buildServicesTaskFactory.js index 856b1b2ca48..9e0a586ff30 100644 --- a/packages/dashmate/src/listr/tasks/buildServicesTaskFactory.js +++ b/packages/dashmate/src/listr/tasks/buildServicesTaskFactory.js @@ -19,7 +19,19 @@ function buildServicesTaskFactory( task: async (ctx, task) => { const envs = config.toEnvs(); - const obs = await dockerCompose.build(envs); + let buildArgs = []; + if (process.env.SCCACHE_GHA_ENABLED === 'true') { + buildArgs = buildArgs.concat([ + '--build-arg', + 'SCCACHE_GHA_ENABLED=true', + '--build-arg', + `ACTIONS_CACHE_URL=${process.env.ACTIONS_CACHE_URL}`, + '--build-arg', + `ACTIONS_RUNTIME_TOKEN=${process.env.ACTIONS_RUNTIME_TOKEN}`, + ]); + } + + const obs = await dockerCompose.build(envs, undefined, buildArgs); await new Promise((res, rej) => { obs diff --git a/packages/js-drive/Dockerfile b/packages/js-drive/Dockerfile index 88df6fa0c93..1d046db0e3b 100644 --- a/packages/js-drive/Dockerfile +++ b/packages/js-drive/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.5 -FROM strophy/buildbase:0.0.4 as builder +FROM strophy/buildbase:0.0.5 as builder WORKDIR /platform @@ -31,7 +31,7 @@ COPY packages/withdrawals-contract packages/withdrawals-contract COPY packages/data-contracts packages/data-contracts # Build RS Drive Node.JS binding -RUN --mount=type=cache,sharing=shared,target=/root/.cache/sccache \ +RUN --mount=type=cache,sharing=private,target=/root/.cache/sccache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \ @@ -40,7 +40,7 @@ RUN --mount=type=cache,sharing=shared,target=/root/.cache/sccache \ sccache --show-stats # Build WASM DPP -RUN --mount=type=cache,sharing=shared,target=/root/.cache/sccache \ +RUN --mount=type=cache,sharing=private,target=/root/.cache/sccache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \ diff --git a/packages/platform-test-suite/Dockerfile b/packages/platform-test-suite/Dockerfile index 320b54acfab..75f2d4c1b56 100644 --- a/packages/platform-test-suite/Dockerfile +++ b/packages/platform-test-suite/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.5 -FROM strophy/buildbase:0.0.4 as builder +FROM strophy/buildbase:0.0.5 as builder WORKDIR /platform @@ -33,7 +33,7 @@ COPY packages/rs-dpp packages/rs-dpp COPY packages/wasm-dpp packages/wasm-dpp # Build WASM DPP -RUN --mount=type=cache,sharing=shared,target=/root/.cache/sccache \ +RUN --mount=type=cache,sharing=private,target=/root/.cache/sccache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \ From 29950666f4175d46543476ed52697241c759b88b Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 13 Apr 2023 17:29:54 +0800 Subject: [PATCH 02/27] ci: increase timeouts and remove extra stats --- .github/workflows/all-packages.yml | 16 ++-------------- .github/workflows/js-checks.yml | 14 +------------- .github/workflows/release.yml | 5 +---- .github/workflows/rs-checks.yml | 12 ------------ 4 files changed, 4 insertions(+), 43 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 64801f5eb86..33e45d95ffd 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -65,7 +65,7 @@ jobs: test-suite: name: Run Platform Test Suite runs-on: ubuntu-22.04 - timeout-minutes: 60 + timeout-minutes: 120 # TODO Change to 60 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -117,10 +117,6 @@ jobs: - name: Build SDK run: yarn build --filter "+dash" - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - - name: Set up Docker BuildX uses: docker/setup-buildx-action@v2 @@ -140,7 +136,7 @@ jobs: test-suite-browsers: name: Run Platform Test Suite in Browsers runs-on: ubuntu-22.04 - timeout-minutes: 60 + timeout-minutes: 60 # TODO Change to 60 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -192,10 +188,6 @@ jobs: - name: Build SDK run: yarn build --filter "+dash" - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - - name: Set up Docker BuildX uses: docker/setup-buildx-action@v2 @@ -273,9 +265,5 @@ jobs: - name: Build package and dependencies run: yarn build --filter "+dash" - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index 58c75fbe44f..1f8048bbb49 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -79,17 +79,13 @@ jobs: - name: Build package and dependencies run: yarn build --filter "+${{ inputs.package }}" - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - - name: Run ESLinter run: yarn workspace "${{ inputs.package }}" lint test: name: Tests runs-on: ubuntu-22.04 - timeout-minutes: 60 + timeout-minutes: 60 # TODO Change to 60 if: ${{ !inputs.skip-tests }} env: SCCACHE_GHA_ENABLED: "true" @@ -150,19 +146,11 @@ jobs: env: NODE_ENV: test - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - # TODO: We build second time here, but with cache it must be quick - name: Build SDK run: yarn build --filter "+dash" if: ${{ inputs.start-local-network }} - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - - name: Create necessary dotenv files run: | cp packages/dapi/.env.example packages/dapi/.env diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b933a8699a..63b8adc3894 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,10 +79,6 @@ jobs: env: CARGO_BUILD_PROFILE: release - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - - name: Download prebuild artifacts uses: actions/download-artifact@v3 with: @@ -909,6 +905,7 @@ jobs: - name: Install Linux build deps if: runner.os == 'Linux' run: sudo apt-get install -y nsis +# TODO: We still need a build # # - name: Setup Node.JS # uses: actions/setup-node@v3 diff --git a/.github/workflows/rs-checks.yml b/.github/workflows/rs-checks.yml index f0d2bdaba7c..34972a606f5 100644 --- a/.github/workflows/rs-checks.yml +++ b/.github/workflows/rs-checks.yml @@ -44,10 +44,6 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} args: --all-features - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - formatting: name: Formatting runs-on: ubuntu-22.04 @@ -96,10 +92,6 @@ jobs: - run: cargo check --package=${{ inputs.package }} - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - test: name: Tests runs-on: ubuntu-22.04 @@ -132,7 +124,3 @@ jobs: - name: Run tests run: cargo test --package=${{ inputs.package }} --all-features - - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats From 13f2d0aea26594680842a70f3916a655285eacfb Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 13 Apr 2023 19:21:01 +0800 Subject: [PATCH 03/27] ci: disable cargo incremental build --- .github/workflows/all-packages.yml | 2 + .github/workflows/js-checks.yml | 2 + .github/workflows/release.yml | 92 ++++++++++++++++-------------- .github/workflows/rs-checks.yml | 3 + .github/workflows/rs-drive.yml | 1 + .github/workflows/wasm-dpp.yml | 1 + 6 files changed, 59 insertions(+), 42 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 33e45d95ffd..54ee7bf2050 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -69,6 +69,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -140,6 +141,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index 1f8048bbb49..134b48441b2 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -31,6 +31,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -90,6 +91,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Setup Firefox uses: browser-actions/setup-firefox@latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 63b8adc3894..ab009fad0a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -122,6 +123,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -255,6 +257,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -387,6 +390,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -588,6 +592,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -749,6 +754,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -868,6 +874,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -905,48 +912,49 @@ jobs: - name: Install Linux build deps if: runner.os == 'Linux' run: sudo apt-get install -y nsis -# TODO: We still need a build -# -# - name: Setup Node.JS -# uses: actions/setup-node@v3 -# with: -# node-version: '16' -# -# - uses: dtolnay/rust-toolchain@master -# with: -# toolchain: stable -# target: wasm32-unknown-unknown -# -# - name: Setup Rust compilation cache -# uses: mozilla-actions/sccache-action@v0.0.3 -# with: -# version: "v0.4.1" -# -# - name: Enable corepack -# run: corepack enable -# -# - name: Disable NPM audit -# run: npm config set audit false -# -# - name: Enable Yarn unplugged modules cache -# uses: actions/cache@v3 -# with: -# path: '.yarn/unplugged' -# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} -# restore-keys: | -# ${{ runner.os }}-yarn-unplugged- -# -# - name: Install dependencies -# run: yarn install -# -# - name: Build packages -# run: yarn build -# env: -# CARGO_BUILD_PROFILE: release -# -# - name: Show Rust compilation cache stats -# shell: bash -# run: ${SCCACHE_PATH} --show-stats + + - name: Setup Node.JS + uses: actions/setup-node@v3 + with: + node-version: '16' + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + target: wasm32-unknown-unknown + + - name: Setup Cargo cache + uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + + - name: Setup Rust compilation cache + uses: mozilla-actions/sccache-action@v0.0.3 + with: + version: "v0.4.1" + + - name: Enable corepack + run: corepack enable + + - name: Disable NPM audit + run: npm config set audit false + + - name: Enable Yarn unplugged modules cache + uses: actions/cache@v3 + with: + path: '.yarn/unplugged' + key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-unplugged- + + - name: Install dependencies + run: yarn install + + - name: Build packages + run: yarn workspace dash run build - name: Create package env: diff --git a/.github/workflows/rs-checks.yml b/.github/workflows/rs-checks.yml index 34972a606f5..b420b5fb965 100644 --- a/.github/workflows/rs-checks.yml +++ b/.github/workflows/rs-checks.yml @@ -16,6 +16,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -67,6 +68,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 @@ -99,6 +101,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 diff --git a/.github/workflows/rs-drive.yml b/.github/workflows/rs-drive.yml index bf7bdd7e958..9583a4c129b 100644 --- a/.github/workflows/rs-drive.yml +++ b/.github/workflows/rs-drive.yml @@ -29,6 +29,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 diff --git a/.github/workflows/wasm-dpp.yml b/.github/workflows/wasm-dpp.yml index d6d5909464d..0a9b62f6f89 100644 --- a/.github/workflows/wasm-dpp.yml +++ b/.github/workflows/wasm-dpp.yml @@ -44,6 +44,7 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" + CARGO_INCREMENTAL: "false" steps: - name: Check out repo uses: actions/checkout@v3 From f4b3a81383e958557512bac8c11a5eebff2c79a7 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 13 Apr 2023 20:43:41 +0800 Subject: [PATCH 04/27] ci: add sccache vars output --- packages/js-drive/Dockerfile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/js-drive/Dockerfile b/packages/js-drive/Dockerfile index 1d046db0e3b..2e37e65272e 100644 --- a/packages/js-drive/Dockerfile +++ b/packages/js-drive/Dockerfile @@ -30,23 +30,21 @@ COPY packages/masternode-reward-shares-contract packages/masternode-reward-share COPY packages/withdrawals-contract packages/withdrawals-contract COPY packages/data-contracts packages/data-contracts -# Build RS Drive Node.JS binding +RUN echo "GHA=$SCCACHE_GHA_ENABLED" +RUN echo "URL=$ACTIONS_CACHE_URL" +RUN echo "TOKEN=$ACTIONS_RUNTIME_TOKEN" +ARG SCCACHE_GHA_ENABLED +ARG ACTIONS_CACHE_URL +ARG ACTIONS_RUNTIME_TOKEN + +# Build RS Drive Node.JS binding and WASM DPP RUN --mount=type=cache,sharing=private,target=/root/.cache/sccache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \ export SCCACHE_SERVER_PORT=$((RANDOM+1025)) && \ yarn workspace @dashevo/rs-drive build && \ - sccache --show-stats - -# Build WASM DPP -RUN --mount=type=cache,sharing=private,target=/root/.cache/sccache \ - --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ - --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \ - --mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \ - export SCCACHE_SERVER_PORT=$((RANDOM+1025)) && \ yarn workspace @dashevo/wasm-dpp build && \ - cargo clean && \ sccache --show-stats # Install Drive-specific dependencies using previous From 2ac834041bcd20fec0521656060c2e7eba910306 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 13 Apr 2023 21:40:50 +0800 Subject: [PATCH 05/27] ci: some optimizations --- .github/workflows/all-packages.yml | 32 ++++++++++++++++++++++ .github/workflows/js-checks.yml | 16 +++++++++++ .github/workflows/release.yml | 36 +++++-------------------- .github/workflows/rs-drive.yml | 4 --- .github/workflows/wasm-dpp.yml | 4 --- packages/dapi/Dockerfile | 7 ++--- packages/dashmate/Dockerfile | 6 ++--- packages/dashmate/src/config/Config.js | 1 + packages/js-drive/Dockerfile | 7 ++--- packages/platform-test-suite/Dockerfile | 6 ++--- 10 files changed, 69 insertions(+), 50 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 54ee7bf2050..9a6bed8ee0b 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -119,8 +119,24 @@ jobs: run: yarn build --filter "+dash" - name: Set up Docker BuildX + id: buildx uses: docker/setup-buildx-action@v2 + - name: Enable docker cache mount + uses: actions/cache@v3 + with: + path: /tmp/buildkit-cache/buildkit-state.tar + key: ${{ runner.os }}-buildkit-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildkit- + + - name: Load docker cache mount + uses: dashevo/gh-action-cache-buildkit-state@v1 + with: + builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 + cache-path: /tmp/buildkit-cache + cache-max-size: 3g + - name: Setup local network run: yarn configure @@ -191,8 +207,24 @@ jobs: run: yarn build --filter "+dash" - name: Set up Docker BuildX + id: buildx uses: docker/setup-buildx-action@v2 + - name: Enable docker cache mount + uses: actions/cache@v3 + with: + path: /tmp/buildkit-cache/buildkit-state.tar + key: ${{ runner.os }}-buildkit-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildkit- + + - name: Load docker cache mount + uses: dashevo/gh-action-cache-buildkit-state@v1 + with: + builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 + cache-path: /tmp/buildkit-cache + cache-max-size: 3g + - name: Setup local network run: yarn configure diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index 134b48441b2..fe1f51c521d 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -160,9 +160,25 @@ jobs: if: ${{ !inputs.start-local-network }} - name: Set up Docker BuildX + id: buildx uses: docker/setup-buildx-action@v2 if: ${{ inputs.start-local-network }} + - name: Enable docker cache mount + uses: actions/cache@v3 + with: + path: /tmp/buildkit-cache/buildkit-state.tar + key: ${{ runner.os }}-buildkit-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildkit- + + - name: Load docker cache mount + uses: dashevo/gh-action-cache-buildkit-state@v1 + with: + builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 + cache-path: /tmp/buildkit-cache + cache-max-size: 3g + - name: Setup local network run: yarn configure if: ${{ inputs.start-local-network }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab009fad0a9..37bf5c9ccd8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -159,10 +159,6 @@ jobs: # run: yarn build --filter "+@dashevo/drive" # env: # CARGO_BUILD_PROFILE: release -# -# - name: Show Rust compilation cache stats -# shell: bash -# run: ${SCCACHE_PATH} --show-stats - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -244,12 +240,6 @@ jobs: ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} CARGO_BUILD_PROFILE=release platforms: linux/amd64,linux/arm64 - cache-from: | - type=gha - # In practice, time spent preparing images is much lower than build. - # We minimize cached info to leave more space for sccache cache. - cache-to: | - type=gha,mode=min release-dapi-docker-image: name: Release DAPI to Docker Hub @@ -291,10 +281,6 @@ jobs: # # - name: Build packages # run: yarn build --filter "+@dashevo/dapi" -# -# - name: Show Rust compilation cache stats -# shell: bash -# run: ${SCCACHE_PATH} --show-stats - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -305,7 +291,7 @@ jobs: with: install: true - - name: Enable buildkit cache + - name: Enable docker cache mount uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar @@ -313,7 +299,7 @@ jobs: restore-keys: | ${{ runner.os }}-buildkit- - - name: Load buildkit state from cache + - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 with: builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 @@ -424,10 +410,6 @@ jobs: # # - name: Build packages # run: yarn build --filter "+@dashevo/platform-test-suite" -# -# - name: Show Rust compilation cache stats -# shell: bash -# run: ${SCCACHE_PATH} --show-stats - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -438,7 +420,7 @@ jobs: with: install: true - - name: Enable buildkit cache + - name: Enable docker cache mount uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar @@ -446,7 +428,7 @@ jobs: restore-keys: | ${{ runner.os }}-buildkit- - - name: Load buildkit state from cache + - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 with: builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 @@ -636,7 +618,7 @@ jobs: with: install: true - - name: Enable buildkit cache + - name: Enable docker cache mount uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar @@ -644,7 +626,7 @@ jobs: restore-keys: | ${{ runner.os }}-buildkit- - - name: Load buildkit state from cache + - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 with: builder: buildx_buildkit_${{ steps.buildx.outputs.name }}0 @@ -708,12 +690,6 @@ jobs: ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }} ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }} CARGO_BUILD_PROFILE=release - cache-from: | - type=gha - # In practice, time spent preparing images is much lower than build. - # We minimize cached info to leave more space for sccache cache. - cache-to: | - type=gha,mode=min # TODO: Implement yarn and rust cache build-rs-drive-nodejs: diff --git a/.github/workflows/rs-drive.yml b/.github/workflows/rs-drive.yml index 9583a4c129b..5ec91ba27b7 100644 --- a/.github/workflows/rs-drive.yml +++ b/.github/workflows/rs-drive.yml @@ -55,10 +55,6 @@ jobs: - run: cargo check --package=drive --no-default-features --features=verify - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats - rs-checks: name: Rust uses: ./.github/workflows/rs-checks.yml diff --git a/.github/workflows/wasm-dpp.yml b/.github/workflows/wasm-dpp.yml index 0a9b62f6f89..91785904a6b 100644 --- a/.github/workflows/wasm-dpp.yml +++ b/.github/workflows/wasm-dpp.yml @@ -70,7 +70,3 @@ jobs: - name: Compile WASM run: cargo check --lib --target wasm32-unknown-unknown --package=wasm-dpp - - - name: Show Rust compilation cache stats - shell: bash - run: ${SCCACHE_PATH} --show-stats diff --git a/packages/dapi/Dockerfile b/packages/dapi/Dockerfile index b8b83ef87ba..c41911f899c 100644 --- a/packages/dapi/Dockerfile +++ b/packages/dapi/Dockerfile @@ -45,6 +45,10 @@ RUN --mount=type=cache,target=/tmp/unplugged \ yarn workspaces focus --production @dashevo/dapi && \ cp -R /platform/.yarn/unplugged /tmp/ + +# Remove Rust sources +RUN rm -rf packages/rs-dpp packages/rs-platform-value + FROM node:16-alpine3.16 ARG NODE_ENV=production @@ -60,9 +64,6 @@ WORKDIR /platform COPY --from=builder /platform /platform -# Remove Rust sources -RUN rm -rf packages/rs-dpp packages/rs-platform-value - RUN cp /platform/packages/dapi/.env.example /platform/packages/dapi/.env EXPOSE 2500 2501 2510 diff --git a/packages/dashmate/Dockerfile b/packages/dashmate/Dockerfile index 50c6c0a5b95..c5bb6f397f5 100644 --- a/packages/dashmate/Dockerfile +++ b/packages/dashmate/Dockerfile @@ -49,6 +49,9 @@ RUN --mount=type=cache,target=/tmp/unplugged \ yarn workspaces focus --production dashmate && \ cp -R /platform/.yarn/unplugged /tmp/ +# Remove Rust sources +RUN rm -rf packages/rs-dpp packages/rs-platform-value + FROM node:16-alpine3.16 ARG NODE_ENV=production @@ -65,7 +68,4 @@ WORKDIR /platform COPY --from=builder /platform /platform -# Remove Rust sources -RUN rm -rf packages/rs-dpp packages/rs-platform-value - ENTRYPOINT ["/platform/packages/dashmate/docker/entrypoint.sh"] diff --git a/packages/dashmate/src/config/Config.js b/packages/dashmate/src/config/Config.js index 9fe370b28d0..27d1cff55e0 100644 --- a/packages/dashmate/src/config/Config.js +++ b/packages/dashmate/src/config/Config.js @@ -175,6 +175,7 @@ class Config { COMPOSE_FILE: dockerComposeFiles.join(':'), COMPOSE_PATH_SEPARATOR: ':', DOCKER_BUILDKIT: 1, + COMPOSE_DOCKER_CLI_BUILD: 1, ...convertObjectToEnvs(this.getOptions()), }; diff --git a/packages/js-drive/Dockerfile b/packages/js-drive/Dockerfile index 2e37e65272e..8cfc40cb6b1 100644 --- a/packages/js-drive/Dockerfile +++ b/packages/js-drive/Dockerfile @@ -45,6 +45,7 @@ RUN --mount=type=cache,sharing=private,target=/root/.cache/sccache \ export SCCACHE_SERVER_PORT=$((RANDOM+1025)) && \ yarn workspace @dashevo/rs-drive build && \ yarn workspace @dashevo/wasm-dpp build && \ + cargo clean && \ sccache --show-stats # Install Drive-specific dependencies using previous @@ -54,6 +55,9 @@ RUN --mount=type=cache,target=/tmp/unplugged \ yarn workspaces focus --production @dashevo/drive && \ cp -R /platform/.yarn/unplugged /tmp/ +# Remove Rust sources +RUN rm -rf packages/rs-drive packages/rs-drive-abci packages/rs-dpp packages/rs-platform-value + FROM node:16-alpine3.16 ARG NODE_ENV=production @@ -69,9 +73,6 @@ WORKDIR /platform COPY --from=builder /platform /platform -# Remove Rust sources -RUN rm -rf packages/rs-drive packages/rs-drive-abci packages/rs-dpp packages/rs-platform-value - RUN cp /platform/packages/js-drive/.env.example /platform/packages/js-drive/.env EXPOSE 26658 diff --git a/packages/platform-test-suite/Dockerfile b/packages/platform-test-suite/Dockerfile index 75f2d4c1b56..dc5f279cc04 100644 --- a/packages/platform-test-suite/Dockerfile +++ b/packages/platform-test-suite/Dockerfile @@ -49,6 +49,9 @@ RUN --mount=type=cache,target=/tmp/unplugged \ yarn workspaces focus --production @dashevo/platform-test-suite && \ cp -R /platform/.yarn/unplugged /tmp/ +# Remove Rust sources +RUN rm -rf packages/rs-dpp packages/rs-platform-value + FROM node:16-alpine3.16 ARG NODE_ENV=production @@ -64,9 +67,6 @@ WORKDIR /platform COPY --from=builder /platform /platform -# Remove Rust sources -RUN rm -rf packages/rs-dpp packages/rs-platform-value - RUN cp /platform/packages/platform-test-suite/.env.example /platform/packages/platform-test-suite/.env EXPOSE 2500 2501 2510 From f2c270a978d43a70dbee0cadd92d4884afa9d3fb Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 13 Apr 2023 22:45:12 +0800 Subject: [PATCH 06/27] build: fix arguments in docker images --- packages/dapi/Dockerfile | 14 +++++++++++--- packages/dashmate/Dockerfile | 14 +++++++++++--- packages/js-drive/Dockerfile | 21 +++++++++++---------- packages/platform-test-suite/Dockerfile | 14 +++++++++++--- 4 files changed, 44 insertions(+), 19 deletions(-) diff --git a/packages/dapi/Dockerfile b/packages/dapi/Dockerfile index c41911f899c..e55932329f4 100644 --- a/packages/dapi/Dockerfile +++ b/packages/dapi/Dockerfile @@ -1,6 +1,17 @@ # syntax = docker/dockerfile:1.5 FROM strophy/buildbase:0.0.5 as builder +# TODO: Probably should be release by default +ARG CARGO_BUILD_PROFILE=debug +ENV CARGO_BUILD_PROFILE ${CARGO_BUILD_PROFILE} + +ARG NODE_ENV=production +ENV NODE_ENV ${NODE_ENV} + +ARG SCCACHE_GHA_ENABLED +ARG ACTIONS_CACHE_URL +ARG ACTIONS_RUNTIME_TOKEN + WORKDIR /platform # Copy yarn and Cargo files @@ -51,9 +62,6 @@ RUN rm -rf packages/rs-dpp packages/rs-platform-value FROM node:16-alpine3.16 -ARG NODE_ENV=production -ENV NODE_ENV ${NODE_ENV} - LABEL maintainer="Dash Developers " LABEL description="DAPI Node.JS" diff --git a/packages/dashmate/Dockerfile b/packages/dashmate/Dockerfile index c5bb6f397f5..e066d45586b 100644 --- a/packages/dashmate/Dockerfile +++ b/packages/dashmate/Dockerfile @@ -1,6 +1,17 @@ # syntax = docker/dockerfile:1.5 FROM strophy/buildbase:0.0.5 as builder +# TODO: Probably should be release by default +ARG CARGO_BUILD_PROFILE=debug +ENV CARGO_BUILD_PROFILE ${CARGO_BUILD_PROFILE} + +ARG NODE_ENV=production +ENV NODE_ENV ${NODE_ENV} + +ARG SCCACHE_GHA_ENABLED +ARG ACTIONS_CACHE_URL +ARG ACTIONS_RUNTIME_TOKEN + WORKDIR /platform # Copy yarn and Cargo files @@ -54,9 +65,6 @@ RUN rm -rf packages/rs-dpp packages/rs-platform-value FROM node:16-alpine3.16 -ARG NODE_ENV=production -ENV NODE_ENV ${NODE_ENV} - RUN apk update && \ apk --no-cache upgrade && \ apk add --no-cache docker-cli docker-cli-compose curl diff --git a/packages/js-drive/Dockerfile b/packages/js-drive/Dockerfile index 8cfc40cb6b1..e83af53f7b2 100644 --- a/packages/js-drive/Dockerfile +++ b/packages/js-drive/Dockerfile @@ -1,6 +1,17 @@ # syntax = docker/dockerfile:1.5 FROM strophy/buildbase:0.0.5 as builder +# TODO: Probably should be release by default +ARG CARGO_BUILD_PROFILE=debug +ENV CARGO_BUILD_PROFILE ${CARGO_BUILD_PROFILE} + +ARG NODE_ENV=production +ENV NODE_ENV ${NODE_ENV} + +ARG SCCACHE_GHA_ENABLED +ARG ACTIONS_CACHE_URL +ARG ACTIONS_RUNTIME_TOKEN + WORKDIR /platform # Copy yarn and Cargo files @@ -30,13 +41,6 @@ COPY packages/masternode-reward-shares-contract packages/masternode-reward-share COPY packages/withdrawals-contract packages/withdrawals-contract COPY packages/data-contracts packages/data-contracts -RUN echo "GHA=$SCCACHE_GHA_ENABLED" -RUN echo "URL=$ACTIONS_CACHE_URL" -RUN echo "TOKEN=$ACTIONS_RUNTIME_TOKEN" -ARG SCCACHE_GHA_ENABLED -ARG ACTIONS_CACHE_URL -ARG ACTIONS_RUNTIME_TOKEN - # Build RS Drive Node.JS binding and WASM DPP RUN --mount=type=cache,sharing=private,target=/root/.cache/sccache \ --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ @@ -60,9 +64,6 @@ RUN rm -rf packages/rs-drive packages/rs-drive-abci packages/rs-dpp packages/rs- FROM node:16-alpine3.16 -ARG NODE_ENV=production -ENV NODE_ENV ${NODE_ENV} - LABEL maintainer="Dash Developers " LABEL description="Drive Node.JS" diff --git a/packages/platform-test-suite/Dockerfile b/packages/platform-test-suite/Dockerfile index dc5f279cc04..e97d61258d4 100644 --- a/packages/platform-test-suite/Dockerfile +++ b/packages/platform-test-suite/Dockerfile @@ -1,6 +1,17 @@ # syntax = docker/dockerfile:1.5 FROM strophy/buildbase:0.0.5 as builder +# TODO: Probably should be release by default +ARG CARGO_BUILD_PROFILE=debug +ENV CARGO_BUILD_PROFILE ${CARGO_BUILD_PROFILE} + +ARG NODE_ENV=production +ENV NODE_ENV ${NODE_ENV} + +ARG SCCACHE_GHA_ENABLED +ARG ACTIONS_CACHE_URL +ARG ACTIONS_RUNTIME_TOKEN + WORKDIR /platform # Copy yarn and Cargo files @@ -54,9 +65,6 @@ RUN rm -rf packages/rs-dpp packages/rs-platform-value FROM node:16-alpine3.16 -ARG NODE_ENV=production -ENV NODE_ENV ${NODE_ENV} - LABEL maintainer="Dash Developers " LABEL description="DAPI Node.JS" From 501019dd2a9943f5af704c400d1e50edc4251803 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 13 Apr 2023 23:14:54 +0800 Subject: [PATCH 07/27] ci: switch to self-hosted runner --- .github/workflows/all-packages.yml | 6 +++--- .github/workflows/js-checks.yml | 4 ++-- .github/workflows/rs-checks.yml | 6 +++--- .github/workflows/rs-drive.yml | 2 +- .github/workflows/wasm-dpp.yml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 9a6bed8ee0b..f2421398aed 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -64,7 +64,7 @@ jobs: test-suite: name: Run Platform Test Suite - runs-on: ubuntu-22.04 + runs-on: self-hosted timeout-minutes: 120 # TODO Change to 60 env: SCCACHE_GHA_ENABLED: "true" @@ -152,8 +152,8 @@ jobs: test-suite-browsers: name: Run Platform Test Suite in Browsers - runs-on: ubuntu-22.04 - timeout-minutes: 60 # TODO Change to 60 + runs-on: self-hosted + timeout-minutes: 120 # TODO Change to 60 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index fe1f51c521d..fc903ae21b3 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -26,7 +26,7 @@ on: jobs: lint: name: Linting - runs-on: ubuntu-22.04 + runs-on: self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" @@ -85,7 +85,7 @@ jobs: test: name: Tests - runs-on: ubuntu-22.04 + runs-on: self-hosted timeout-minutes: 60 # TODO Change to 60 if: ${{ !inputs.skip-tests }} env: diff --git a/.github/workflows/rs-checks.yml b/.github/workflows/rs-checks.yml index b420b5fb965..6a8edab4cc9 100644 --- a/.github/workflows/rs-checks.yml +++ b/.github/workflows/rs-checks.yml @@ -11,7 +11,7 @@ on: jobs: lint: name: Linting - runs-on: ubuntu-22.04 + runs-on: self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" @@ -63,7 +63,7 @@ jobs: compile: name: Compilation errors - runs-on: ubuntu-22.04 + runs-on: self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" @@ -96,7 +96,7 @@ jobs: test: name: Tests - runs-on: ubuntu-22.04 + runs-on: self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" diff --git a/.github/workflows/rs-drive.yml b/.github/workflows/rs-drive.yml index 5ec91ba27b7..f0374313a6b 100644 --- a/.github/workflows/rs-drive.yml +++ b/.github/workflows/rs-drive.yml @@ -24,7 +24,7 @@ concurrency: jobs: feature-compilation: name: Feature compilation errors - runs-on: ubuntu-22.04 + runs-on: self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" diff --git a/.github/workflows/wasm-dpp.yml b/.github/workflows/wasm-dpp.yml index 91785904a6b..dc90a26d047 100644 --- a/.github/workflows/wasm-dpp.yml +++ b/.github/workflows/wasm-dpp.yml @@ -40,7 +40,7 @@ jobs: wasm-errors: name: WASM compilation - runs-on: ubuntu-22.04 + runs-on: self-hosted env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" From b6178fa472aac121d696edcf8e6f4813bdc68fc3 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 13 Apr 2023 23:38:31 +0800 Subject: [PATCH 08/27] chore: empty commit to fix CI From 8938a25f8f06c3f78bdced40f0c735da16fd025d Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Thu, 13 Apr 2023 23:42:00 +0800 Subject: [PATCH 09/27] ci: switch back normal --- .github/workflows/all-packages.yml | 4 ++-- .github/workflows/js-checks.yml | 4 ++-- .github/workflows/rs-checks.yml | 6 +++--- .github/workflows/rs-drive.yml | 2 +- .github/workflows/wasm-dpp.yml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index f2421398aed..fdc5a56a9a6 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -64,7 +64,7 @@ jobs: test-suite: name: Run Platform Test Suite - runs-on: self-hosted + runs-on: ubuntu-22.04 # self-hosted timeout-minutes: 120 # TODO Change to 60 env: SCCACHE_GHA_ENABLED: "true" @@ -152,7 +152,7 @@ jobs: test-suite-browsers: name: Run Platform Test Suite in Browsers - runs-on: self-hosted + runs-on: ubuntu-22.04 # self-hosted timeout-minutes: 120 # TODO Change to 60 env: SCCACHE_GHA_ENABLED: "true" diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index fc903ae21b3..f0cfa49d013 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -26,7 +26,7 @@ on: jobs: lint: name: Linting - runs-on: self-hosted + runs-on: ubuntu-22.04 # self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" @@ -85,7 +85,7 @@ jobs: test: name: Tests - runs-on: self-hosted + runs-on: ubuntu-22.04 # self-hosted timeout-minutes: 60 # TODO Change to 60 if: ${{ !inputs.skip-tests }} env: diff --git a/.github/workflows/rs-checks.yml b/.github/workflows/rs-checks.yml index 6a8edab4cc9..99ef14190ec 100644 --- a/.github/workflows/rs-checks.yml +++ b/.github/workflows/rs-checks.yml @@ -11,7 +11,7 @@ on: jobs: lint: name: Linting - runs-on: self-hosted + runs-on: ubuntu-22.04 # self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" @@ -63,7 +63,7 @@ jobs: compile: name: Compilation errors - runs-on: self-hosted + runs-on: ubuntu-22.04 # self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" @@ -96,7 +96,7 @@ jobs: test: name: Tests - runs-on: self-hosted + runs-on: ubuntu-22.04 # self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" diff --git a/.github/workflows/rs-drive.yml b/.github/workflows/rs-drive.yml index f0374313a6b..90e66d72e2e 100644 --- a/.github/workflows/rs-drive.yml +++ b/.github/workflows/rs-drive.yml @@ -24,7 +24,7 @@ concurrency: jobs: feature-compilation: name: Feature compilation errors - runs-on: self-hosted + runs-on: ubuntu-22.04 # self-hosted timeout-minutes: 20 env: SCCACHE_GHA_ENABLED: "true" diff --git a/.github/workflows/wasm-dpp.yml b/.github/workflows/wasm-dpp.yml index dc90a26d047..e811177b4f0 100644 --- a/.github/workflows/wasm-dpp.yml +++ b/.github/workflows/wasm-dpp.yml @@ -40,7 +40,7 @@ jobs: wasm-errors: name: WASM compilation - runs-on: self-hosted + runs-on: ubuntu-22.04 # self-hosted env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" From 6ff2693070e96924d13d3cee421075626e668c1c Mon Sep 17 00:00:00 2001 From: strophy Date: Fri, 14 Apr 2023 12:44:46 +1000 Subject: [PATCH 10/27] chore: enable self-hosted for test suite --- .github/workflows/all-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index fdc5a56a9a6..0820e6f8fc2 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -64,7 +64,7 @@ jobs: test-suite: name: Run Platform Test Suite - runs-on: ubuntu-22.04 # self-hosted + runs-on: self-hosted # ubuntu-22.04 timeout-minutes: 120 # TODO Change to 60 env: SCCACHE_GHA_ENABLED: "true" From f88be127d3979462c63a0765831acdaed282cd6e Mon Sep 17 00:00:00 2001 From: strophy Date: Fri, 14 Apr 2023 12:53:52 +1000 Subject: [PATCH 11/27] chore: enable self-hosted for test-suite browsers --- .github/workflows/all-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 0820e6f8fc2..e4530a1a02a 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -152,7 +152,7 @@ jobs: test-suite-browsers: name: Run Platform Test Suite in Browsers - runs-on: ubuntu-22.04 # self-hosted + runs-on: self-hosted # ubuntu-22.04 timeout-minutes: 120 # TODO Change to 60 env: SCCACHE_GHA_ENABLED: "true" From 14260da19fb77c7e2d5143f1cbb1da323e1e2239 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 14 Apr 2023 12:07:02 +0800 Subject: [PATCH 12/27] build: remove apt cache --- packages/dashmate/docker/envoy/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/dashmate/docker/envoy/Dockerfile b/packages/dashmate/docker/envoy/Dockerfile index 5261e33568d..9bb17a1b0a9 100644 --- a/packages/dashmate/docker/envoy/Dockerfile +++ b/packages/dashmate/docker/envoy/Dockerfile @@ -1,7 +1,8 @@ FROM envoyproxy/envoy:v1.22-latest as builder RUN apt update && \ - apt -qq -y install python + apt -qq -y install python && \ + rm -rf /var/lib/apt/lists/* COPY packages/dashmate/docker/envoy/hot-restarter.py /etc/envoy/hot-restarter.py COPY packages/dashmate/docker/envoy/start_envoy.sh /etc/envoy/start_envoy.sh From 2ad9671c9b4e316a82230a7edd62285678db3cd2 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 14 Apr 2023 12:07:33 +0800 Subject: [PATCH 13/27] ci: enable self-hosted, adjust timeouts and cache key --- .github/workflows/all-packages.yml | 12 ++++++------ .github/workflows/js-checks.yml | 12 ++++++------ .github/workflows/release.yml | 16 ++++++++-------- .github/workflows/rs-checks.yml | 12 ++++++------ .github/workflows/rs-drive.yml | 4 ++-- .github/workflows/wasm-dpp.yml | 2 +- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index e4530a1a02a..9754d7504ed 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -65,7 +65,7 @@ jobs: test-suite: name: Run Platform Test Suite runs-on: self-hosted # ubuntu-22.04 - timeout-minutes: 120 # TODO Change to 60 + timeout-minutes: 30 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -126,9 +126,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} + key: ${{ runner.os }}-buildkit restore-keys: | - ${{ runner.os }}-buildkit- + ${{ runner.os }}-buildkit - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 @@ -153,7 +153,7 @@ jobs: test-suite-browsers: name: Run Platform Test Suite in Browsers runs-on: self-hosted # ubuntu-22.04 - timeout-minutes: 120 # TODO Change to 60 + timeout-minutes: 30 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -214,9 +214,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} + key: ${{ runner.os }}-buildkit restore-keys: | - ${{ runner.os }}-buildkit- + ${{ runner.os }}-buildkit - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index f0cfa49d013..12050a9bf00 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -26,8 +26,8 @@ on: jobs: lint: name: Linting - runs-on: ubuntu-22.04 # self-hosted - timeout-minutes: 20 + runs-on: self-hosted + timeout-minutes: 15 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -85,8 +85,8 @@ jobs: test: name: Tests - runs-on: ubuntu-22.04 # self-hosted - timeout-minutes: 60 # TODO Change to 60 + runs-on: self-hosted + timeout-minutes: 30 if: ${{ !inputs.skip-tests }} env: SCCACHE_GHA_ENABLED: "true" @@ -168,9 +168,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} + key: ${{ runner.os }}-buildkit restore-keys: | - ${{ runner.os }}-buildkit- + ${{ runner.os }}-buildkit - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37bf5c9ccd8..30ae6cf2cee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -172,9 +172,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} + key: ${{ runner.os }}-buildkit restore-keys: | - ${{ runner.os }}-buildkit- + ${{ runner.os }}-buildkit - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 @@ -295,9 +295,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} + key: ${{ runner.os }}-buildkit restore-keys: | - ${{ runner.os }}-buildkit- + ${{ runner.os }}-buildkit - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 @@ -424,9 +424,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} + key: ${{ runner.os }}-buildkit restore-keys: | - ${{ runner.os }}-buildkit- + ${{ runner.os }}-buildkit - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 @@ -622,9 +622,9 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit-${{ github.sha }} + key: ${{ runner.os }}-buildkit restore-keys: | - ${{ runner.os }}-buildkit- + ${{ runner.os }}-buildkit - name: Load docker cache mount uses: dashevo/gh-action-cache-buildkit-state@v1 diff --git a/.github/workflows/rs-checks.yml b/.github/workflows/rs-checks.yml index 99ef14190ec..cd340ffde94 100644 --- a/.github/workflows/rs-checks.yml +++ b/.github/workflows/rs-checks.yml @@ -11,8 +11,8 @@ on: jobs: lint: name: Linting - runs-on: ubuntu-22.04 # self-hosted - timeout-minutes: 20 + runs-on: self-hosted + timeout-minutes: 15 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -63,8 +63,8 @@ jobs: compile: name: Compilation errors - runs-on: ubuntu-22.04 # self-hosted - timeout-minutes: 20 + runs-on: self-hosted + timeout-minutes: 15 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -96,8 +96,8 @@ jobs: test: name: Tests - runs-on: ubuntu-22.04 # self-hosted - timeout-minutes: 20 + runs-on: self-hosted + timeout-minutes: 15 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" diff --git a/.github/workflows/rs-drive.yml b/.github/workflows/rs-drive.yml index 90e66d72e2e..b1582a8460f 100644 --- a/.github/workflows/rs-drive.yml +++ b/.github/workflows/rs-drive.yml @@ -24,8 +24,8 @@ concurrency: jobs: feature-compilation: name: Feature compilation errors - runs-on: ubuntu-22.04 # self-hosted - timeout-minutes: 20 + runs-on: self-hosted + timeout-minutes: 15 env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" diff --git a/.github/workflows/wasm-dpp.yml b/.github/workflows/wasm-dpp.yml index e811177b4f0..dc90a26d047 100644 --- a/.github/workflows/wasm-dpp.yml +++ b/.github/workflows/wasm-dpp.yml @@ -40,7 +40,7 @@ jobs: wasm-errors: name: WASM compilation - runs-on: ubuntu-22.04 # self-hosted + runs-on: self-hosted env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" From 3a826e5b6d32b611f3addc94184ffdabf7217e29 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 14 Apr 2023 12:58:36 +0800 Subject: [PATCH 14/27] ci: install chrome --- .github/workflows/all-packages.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 9754d7504ed..1c55fe9bc86 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -159,6 +159,11 @@ jobs: RUSTC_WRAPPER: "sccache" CARGO_INCREMENTAL: "false" steps: + - name: Install Chrome + uses: browser-actions/setup-chrome@v1 + with: + chrome-version: stable + - name: Check out repo uses: actions/checkout@v3 From 76758494843725ef0b98b9e3ed5d9262cbe4442d Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 14 Apr 2023 13:11:59 +0800 Subject: [PATCH 15/27] chore: empty commit to fix CI From bf7ffbcce3f9541b88f36e99f33de1d82d6671af Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 14 Apr 2023 13:42:30 +0800 Subject: [PATCH 16/27] ci: fix back docker mount cache --- .github/workflows/all-packages.yml | 4 ++-- .github/workflows/js-checks.yml | 2 +- .github/workflows/release.yml | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 1c55fe9bc86..59e910873ff 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -126,7 +126,7 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit + key: ${{ runner.os }}-buildkit-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildkit @@ -219,7 +219,7 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit + key: ${{ runner.os }}-buildkit-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildkit diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index 12050a9bf00..e59a2fbc42c 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -168,7 +168,7 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit + key: ${{ runner.os }}-buildkit-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildkit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30ae6cf2cee..461b7a78494 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -172,7 +172,7 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit + key: ${{ runner.os }}-buildkit-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildkit @@ -295,7 +295,7 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit + key: ${{ runner.os }}-buildkit-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildkit @@ -424,7 +424,7 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit + key: ${{ runner.os }}-buildkit-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildkit @@ -622,7 +622,7 @@ jobs: uses: actions/cache@v3 with: path: /tmp/buildkit-cache/buildkit-state.tar - key: ${{ runner.os }}-buildkit + key: ${{ runner.os }}-buildkit-${{ github.sha }} restore-keys: | ${{ runner.os }}-buildkit From fcda9d0b99a40540c874dff9a8aca40342c08e29 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 14 Apr 2023 14:53:27 +0800 Subject: [PATCH 17/27] ci: fix release workflow --- .github/workflows/release.yml | 232 ++++++++++++++++++---------------- 1 file changed, 124 insertions(+), 108 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 461b7a78494..e6ee8f41733 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ concurrency: jobs: release-npm: name: Release NPM packages - runs-on: ubuntu-22.04 + runs-on: self-hosted if: github.event_name != 'workflow_dispatch' needs: - build-rs-drive-nodejs @@ -119,7 +119,7 @@ jobs: release-drive-docker-image: name: Release Drive to Docker Hub - runs-on: ubuntu-22.04 + runs-on: self-hosted env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -132,33 +132,33 @@ jobs: uses: mozilla-actions/sccache-action@v0.0.3 with: version: "v0.4.1" -# -# - name: Setup Node.JS -# uses: actions/setup-node@v3 -# with: -# node-version: '16' -# -# - name: Enable corepack -# run: corepack enable -# -# - name: Disable NPM audit -# run: npm config set audit false -# -# - name: Enable Yarn unplugged modules cache -# uses: actions/cache@v3 -# with: -# path: '.yarn/unplugged' -# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} -# restore-keys: | -# ${{ runner.os }}-yarn-unplugged- -# -# - name: Install dependencies -# run: yarn install -# -# - name: Build packages -# run: yarn build --filter "+@dashevo/drive" -# env: -# CARGO_BUILD_PROFILE: release + + - name: Setup Node.JS + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Enable corepack + run: corepack enable + + - name: Disable NPM audit + run: npm config set audit false + + - name: Enable Yarn unplugged modules cache + uses: actions/cache@v3 + with: + path: '.yarn/unplugged' + key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-unplugged- + + - name: Install dependencies + run: yarn install + + - name: Build packages + run: yarn build --filter "+@dashevo/drive" + env: + CARGO_BUILD_PROFILE: release - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -243,7 +243,7 @@ jobs: release-dapi-docker-image: name: Release DAPI to Docker Hub - runs-on: ubuntu-22.04 + runs-on: self-hosted env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -256,31 +256,33 @@ jobs: uses: mozilla-actions/sccache-action@v0.0.3 with: version: "v0.4.1" -# -# - name: Setup Node.JS -# uses: actions/setup-node@v3 -# with: -# node-version: '16' -# -# - name: Enable corepack -# run: corepack enable -# -# - name: Disable NPM audit -# run: npm config set audit false -# -# - name: Enable Yarn unplugged modules cache -# uses: actions/cache@v3 -# with: -# path: '.yarn/unplugged' -# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} -# restore-keys: | -# ${{ runner.os }}-yarn-unplugged- -# -# - name: Install dependencies -# run: yarn install -# -# - name: Build packages -# run: yarn build --filter "+@dashevo/dapi" + + - name: Setup Node.JS + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Enable corepack + run: corepack enable + + - name: Disable NPM audit + run: npm config set audit false + + - name: Enable Yarn unplugged modules cache + uses: actions/cache@v3 + with: + path: '.yarn/unplugged' + key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-unplugged- + + - name: Install dependencies + run: yarn install + + - name: Build packages + run: yarn build --filter "+@dashevo/dapi" + env: + CARGO_BUILD_PROFILE: release - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -372,7 +374,7 @@ jobs: release-test-suite-docker-image: name: Release Test Suite to Docker Hub - runs-on: ubuntu-22.04 + runs-on: self-hosted env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -385,31 +387,33 @@ jobs: uses: mozilla-actions/sccache-action@v0.0.3 with: version: "v0.4.1" -# -# - name: Setup Node.JS -# uses: actions/setup-node@v3 -# with: -# node-version: '16' -# -# - name: Enable corepack -# run: corepack enable -# -# - name: Disable NPM audit -# run: npm config set audit false -# -# - name: Enable Yarn unplugged modules cache -# uses: actions/cache@v3 -# with: -# path: '.yarn/unplugged' -# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} -# restore-keys: | -# ${{ runner.os }}-yarn-unplugged- -# -# - name: Install dependencies -# run: yarn install -# -# - name: Build packages -# run: yarn build --filter "+@dashevo/platform-test-suite" + + - name: Setup Node.JS + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Enable corepack + run: corepack enable + + - name: Disable NPM audit + run: npm config set audit false + + - name: Enable Yarn unplugged modules cache + uses: actions/cache@v3 + with: + path: '.yarn/unplugged' + key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-unplugged- + + - name: Install dependencies + run: yarn install + + - name: Build packages + run: yarn build --filter "+@dashevo/platform-test-suite" + env: + CARGO_BUILD_PROFILE: release - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -570,7 +574,7 @@ jobs: release-dashmate-helper-docker-image: name: Release Dashmate helper to Docker Hub - runs-on: ubuntu-22.04 + runs-on: self-hosted env: SCCACHE_GHA_ENABLED: "true" RUSTC_WRAPPER: "sccache" @@ -583,31 +587,33 @@ jobs: uses: mozilla-actions/sccache-action@v0.0.3 with: version: "v0.4.1" -# -# - name: Setup Node.JS -# uses: actions/setup-node@v3 -# with: -# node-version: '16' -# -# - name: Enable corepack -# run: corepack enable -# -# - name: Disable NPM audit -# run: npm config set audit false -# -# - name: Enable Yarn unplugged modules cache -# uses: actions/cache@v3 -# with: -# path: '.yarn/unplugged' -# key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} -# restore-keys: | -# ${{ runner.os }}-yarn-unplugged- -# -# - name: Install dependencies -# run: yarn install -# -# - name: Build packages -# run: yarn build --filter "+dashmate" + + - name: Setup Node.JS + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Enable corepack + run: corepack enable + + - name: Disable NPM audit + run: npm config set audit false + + - name: Enable Yarn unplugged modules cache + uses: actions/cache@v3 + with: + path: '.yarn/unplugged' + key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-unplugged- + + - name: Install dependencies + run: yarn install + + - name: Build packages + run: yarn build --filter "+dashmate" + env: + CARGO_BUILD_PROFILE: release - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -780,7 +786,16 @@ jobs: toolchain: stable target: ${{ steps.set-target.outputs.result }} + - name: Setup Cargo cache + uses: Swatinem/rust-cache@v2 + with: + # Don't cache ./target, as it takes tons of space, use sccache instead. + cache-targets: false + # We set a shared key, as our cache is reusable between jobs + shared-key: rust-cargo + - name: Setup Rust compilation cache + if: ${{ runner.os == 'macOS' }} uses: mozilla-actions/sccache-action@v0.0.3 with: version: "v0.4.1" @@ -929,8 +944,9 @@ jobs: - name: Install dependencies run: yarn install + # TODO: We don't need to build it, since pack should use released npm packages - name: Build packages - run: yarn workspace dash run build + run: yarn build --filter "+dashmate" - name: Create package env: From 20b8f1da8feb400acb112cb89fddc833ae3c78fe Mon Sep 17 00:00:00 2001 From: strophy Date: Fri, 14 Apr 2023 17:22:24 +1000 Subject: [PATCH 18/27] chore: empty commit to trigger fresh ci From e0a303cb73e656f947a5f9f75b28559d9cd16b7d Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 14 Apr 2023 16:49:05 +0800 Subject: [PATCH 19/27] ci: login to docker hub --- .github/workflows/all-packages.yml | 18 ++++++++ .github/workflows/js-checks.yml | 17 ++++++++ .github/workflows/release.yml | 66 ++++++++++++++++-------------- 3 files changed, 71 insertions(+), 30 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 59e910873ff..71454a0f1f1 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -74,6 +74,12 @@ jobs: - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Node.JS uses: actions/setup-node@v3 with: @@ -164,6 +170,12 @@ jobs: with: chrome-version: stable + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Check out repo uses: actions/checkout@v3 @@ -254,6 +266,12 @@ jobs: - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Node.JS uses: actions/setup-node@v3 with: diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index e59a2fbc42c..14dc21aec77 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -36,6 +36,12 @@ jobs: - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Node.JS uses: actions/setup-node@v3 with: @@ -99,9 +105,20 @@ jobs: with: firefox-version: 'latest' + - name: Install Chrome + uses: browser-actions/setup-chrome@v1 + with: + chrome-version: stable + - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Node.JS uses: actions/setup-node@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6ee8f41733..2394438f313 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -128,6 +128,12 @@ jobs: - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Rust compilation cache uses: mozilla-actions/sccache-action@v0.0.3 with: @@ -183,12 +189,6 @@ jobs: cache-path: /tmp/buildkit-cache cache-max-size: 3g - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Get tag uses: actions/github-script@v6 id: tag @@ -252,6 +252,12 @@ jobs: - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Rust compilation cache uses: mozilla-actions/sccache-action@v0.0.3 with: @@ -308,12 +314,6 @@ jobs: cache-path: /tmp/buildkit-cache cache-max-size: 3g - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Get tag uses: actions/github-script@v6 id: tag @@ -383,6 +383,12 @@ jobs: - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Rust compilation cache uses: mozilla-actions/sccache-action@v0.0.3 with: @@ -439,12 +445,6 @@ jobs: cache-path: /tmp/buildkit-cache cache-max-size: 3g - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Get tag uses: actions/github-script@v6 id: tag @@ -510,6 +510,12 @@ jobs: - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up QEMU to run multi-arch builds uses: docker/setup-qemu-action@v2 @@ -519,12 +525,6 @@ jobs: with: install: true - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Get tag uses: actions/github-script@v6 id: tag @@ -583,6 +583,12 @@ jobs: - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Rust compilation cache uses: mozilla-actions/sccache-action@v0.0.3 with: @@ -639,12 +645,6 @@ jobs: cache-path: /tmp/buildkit-cache cache-max-size: 3g - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Get tag uses: actions/github-script@v6 id: tag @@ -741,6 +741,12 @@ jobs: - name: Check out repo uses: actions/checkout@v3 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Setup Node.JS uses: actions/setup-node@v3 with: From c06d807f5afb23f03ae945113226bb6ca577fa18 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Fri, 14 Apr 2023 19:03:01 +0800 Subject: [PATCH 20/27] chore: empty commit to fix CI From c3cde96bc158c8a302c74a23328a1f3c1a8939c3 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 17 Apr 2023 16:23:33 +0800 Subject: [PATCH 21/27] build: update base image --- packages/dapi/Dockerfile | 2 +- packages/dashmate/Dockerfile | 2 +- packages/js-drive/Dockerfile | 2 +- packages/platform-test-suite/Dockerfile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dapi/Dockerfile b/packages/dapi/Dockerfile index e55932329f4..1254519a369 100644 --- a/packages/dapi/Dockerfile +++ b/packages/dapi/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.5 -FROM strophy/buildbase:0.0.5 as builder +FROM strophy/buildbase:0.0.6 as builder # TODO: Probably should be release by default ARG CARGO_BUILD_PROFILE=debug diff --git a/packages/dashmate/Dockerfile b/packages/dashmate/Dockerfile index e066d45586b..17b411da013 100644 --- a/packages/dashmate/Dockerfile +++ b/packages/dashmate/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.5 -FROM strophy/buildbase:0.0.5 as builder +FROM strophy/buildbase:0.0.6 as builder # TODO: Probably should be release by default ARG CARGO_BUILD_PROFILE=debug diff --git a/packages/js-drive/Dockerfile b/packages/js-drive/Dockerfile index e83af53f7b2..6f920044f68 100644 --- a/packages/js-drive/Dockerfile +++ b/packages/js-drive/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.5 -FROM strophy/buildbase:0.0.5 as builder +FROM strophy/buildbase:0.0.6 as builder # TODO: Probably should be release by default ARG CARGO_BUILD_PROFILE=debug diff --git a/packages/platform-test-suite/Dockerfile b/packages/platform-test-suite/Dockerfile index e97d61258d4..a4d9bd345a6 100644 --- a/packages/platform-test-suite/Dockerfile +++ b/packages/platform-test-suite/Dockerfile @@ -1,5 +1,5 @@ # syntax = docker/dockerfile:1.5 -FROM strophy/buildbase:0.0.5 as builder +FROM strophy/buildbase:0.0.6 as builder # TODO: Probably should be release by default ARG CARGO_BUILD_PROFILE=debug From 82940103f6c0a05e559426f0aa23e2de173e13bd Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 17 Apr 2023 17:27:29 +0800 Subject: [PATCH 22/27] ci: chrome already installed --- .github/workflows/all-packages.yml | 5 ----- .github/workflows/js-checks.yml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 71454a0f1f1..01db2da1d29 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -165,11 +165,6 @@ jobs: RUSTC_WRAPPER: "sccache" CARGO_INCREMENTAL: "false" steps: - - name: Install Chrome - uses: browser-actions/setup-chrome@v1 - with: - chrome-version: stable - - name: Login to DockerHub uses: docker/login-action@v2 with: diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index 14dc21aec77..9f137a224f0 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -105,11 +105,6 @@ jobs: with: firefox-version: 'latest' - - name: Install Chrome - uses: browser-actions/setup-chrome@v1 - with: - chrome-version: stable - - name: Check out repo uses: actions/checkout@v3 From b3097bf65fa9e73788db7679d1b23f3e0f33dab5 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 17 Apr 2023 20:41:24 +0800 Subject: [PATCH 23/27] ci: test secret --- .github/workflows/all-packages.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 01db2da1d29..23aa4adb751 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -18,6 +18,13 @@ concurrency: cancel-in-progress: true jobs: + test-secret: + name: Test secret + runs-on: ubuntu-22.04 + steps: + - name: Test secret + run: echo ${{ secrets.TEST_SECRET }} + deps-versions: name: JS dependency versions check runs-on: ubuntu-22.04 From 2564b8ff0c47eb2c0063e9792a7b61b733ee327b Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 17 Apr 2023 21:01:56 +0800 Subject: [PATCH 24/27] chore: empty commit to fix CI From d91bb5cd7900a72d68c8378d0a9305444cf43de5 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Mon, 17 Apr 2023 22:09:06 +0800 Subject: [PATCH 25/27] ci: test secret --- .github/workflows/all-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 23aa4adb751..cc55f008603 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Test secret - run: echo ${{ secrets.TEST_SECRET }} + run: echo ${{ secrets.TEST_SECRET }} && echo ${{ secrets.DOCKERHUB_USERNAME }} && echo ${{ secrets.DOCKERHUB_TOKEN }} deps-versions: name: JS dependency versions check From 675364bb35886edb948c1d2039d4c163e2d31c89 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Tue, 18 Apr 2023 03:42:01 +0800 Subject: [PATCH 26/27] ci: test secret --- .github/workflows/all-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index cc55f008603..28f63466653 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Test secret - run: echo ${{ secrets.TEST_SECRET }} && echo ${{ secrets.DOCKERHUB_USERNAME }} && echo ${{ secrets.DOCKERHUB_TOKEN }} + run: echo ${{ secrets.UNKNOWN }} deps-versions: name: JS dependency versions check From b9b4f0d38703798da08ab050c9eb16fb7aceed11 Mon Sep 17 00:00:00 2001 From: Ivan Shumkov Date: Tue, 18 Apr 2023 03:50:42 +0800 Subject: [PATCH 27/27] ci: fix secret --- .github/workflows/all-packages.yml | 7 ------- .github/workflows/dapi-grpc.yml | 2 ++ .github/workflows/dapi.yml | 2 ++ .github/workflows/dash-spv.yml | 2 ++ .github/workflows/dashmate.yml | 2 ++ .github/workflows/dashpay-contract.yml | 2 ++ .github/workflows/js-checks.yml | 16 ++++++++++++---- .github/workflows/js-dapi-client.yml | 2 ++ .github/workflows/js-dash-sdk.yml | 2 ++ .github/workflows/js-dpp.yml | 2 ++ .github/workflows/js-drive.yml | 2 ++ .github/workflows/js-grpc-common.yml | 2 ++ .github/workflows/platform-test-suite.yml | 2 ++ .github/workflows/rs-drive-nodejs.yml | 2 ++ .github/workflows/wallet-lib.yml | 2 ++ .github/workflows/wasm-dpp.yml | 2 ++ 16 files changed, 40 insertions(+), 11 deletions(-) diff --git a/.github/workflows/all-packages.yml b/.github/workflows/all-packages.yml index 28f63466653..01db2da1d29 100644 --- a/.github/workflows/all-packages.yml +++ b/.github/workflows/all-packages.yml @@ -18,13 +18,6 @@ concurrency: cancel-in-progress: true jobs: - test-secret: - name: Test secret - runs-on: ubuntu-22.04 - steps: - - name: Test secret - run: echo ${{ secrets.UNKNOWN }} - deps-versions: name: JS dependency versions check runs-on: ubuntu-22.04 diff --git a/.github/workflows/dapi-grpc.yml b/.github/workflows/dapi-grpc.yml index d95ab52480e..010d8e1987d 100644 --- a/.github/workflows/dapi-grpc.yml +++ b/.github/workflows/dapi-grpc.yml @@ -24,3 +24,5 @@ jobs: uses: ./.github/workflows/js-checks.yml with: package: '@dashevo/dapi-grpc' + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/dapi.yml b/.github/workflows/dapi.yml index 5b69d026a05..c2066d51ef2 100644 --- a/.github/workflows/dapi.yml +++ b/.github/workflows/dapi.yml @@ -34,3 +34,5 @@ jobs: uses: ./.github/workflows/js-checks.yml with: package: '@dashevo/dapi' + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/dash-spv.yml b/.github/workflows/dash-spv.yml index 87882ab9aec..1585d0b1b87 100644 --- a/.github/workflows/dash-spv.yml +++ b/.github/workflows/dash-spv.yml @@ -23,3 +23,5 @@ jobs: uses: ./.github/workflows/js-checks.yml with: package: '@dashevo/dash-spv' + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/dashmate.yml b/.github/workflows/dashmate.yml index 56ccba3a656..1596a256153 100644 --- a/.github/workflows/dashmate.yml +++ b/.github/workflows/dashmate.yml @@ -36,3 +36,5 @@ jobs: uses: ./.github/workflows/js-checks.yml with: package: 'dashmate' + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/dashpay-contract.yml b/.github/workflows/dashpay-contract.yml index 8eaae682be1..88c6a4f36af 100644 --- a/.github/workflows/dashpay-contract.yml +++ b/.github/workflows/dashpay-contract.yml @@ -28,3 +28,5 @@ jobs: uses: ./.github/workflows/js-checks.yml with: package: '@dashevo/dashpay-contract' + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/js-checks.yml b/.github/workflows/js-checks.yml index 9f137a224f0..72a6dc99cc8 100644 --- a/.github/workflows/js-checks.yml +++ b/.github/workflows/js-checks.yml @@ -22,6 +22,14 @@ on: type: boolean default: false required: false + dockerhub-username: + description: DockerHub username + type: string + required: true + dockerhub-token: + description: DockerHub token + type: string + required: true jobs: lint: @@ -39,8 +47,8 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ inputs.dockerhub-username }} + password: ${{ inputs.dockerhub-token }} - name: Setup Node.JS uses: actions/setup-node@v3 @@ -111,8 +119,8 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ inputs.dockerhub-username }} + password: ${{ inputs.dockerhub-token }} - name: Setup Node.JS uses: actions/setup-node@v3 diff --git a/.github/workflows/js-dapi-client.yml b/.github/workflows/js-dapi-client.yml index b1a8b3ed831..e14859d9cd6 100644 --- a/.github/workflows/js-dapi-client.yml +++ b/.github/workflows/js-dapi-client.yml @@ -32,3 +32,5 @@ jobs: with: package: '@dashevo/dapi-client' install-browsers: true + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/js-dash-sdk.yml b/.github/workflows/js-dash-sdk.yml index 60cb9a82e69..9ae6eb8614d 100644 --- a/.github/workflows/js-dash-sdk.yml +++ b/.github/workflows/js-dash-sdk.yml @@ -35,3 +35,5 @@ jobs: package: 'dash' start-local-network: true install-browsers: true + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/js-dpp.yml b/.github/workflows/js-dpp.yml index 064c87ff09f..64bd9eb5b10 100644 --- a/.github/workflows/js-dpp.yml +++ b/.github/workflows/js-dpp.yml @@ -28,3 +28,5 @@ jobs: with: package: '@dashevo/dpp' install-browsers: true + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/js-drive.yml b/.github/workflows/js-drive.yml index 3d850ad8ce7..c4f0782cd3e 100644 --- a/.github/workflows/js-drive.yml +++ b/.github/workflows/js-drive.yml @@ -31,3 +31,5 @@ jobs: uses: ./.github/workflows/js-checks.yml with: package: '@dashevo/drive' + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/js-grpc-common.yml b/.github/workflows/js-grpc-common.yml index 7541c43d273..ffc2ea10891 100644 --- a/.github/workflows/js-grpc-common.yml +++ b/.github/workflows/js-grpc-common.yml @@ -23,3 +23,5 @@ jobs: uses: ./.github/workflows/js-checks.yml with: package: '@dashevo/grpc-common' + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/platform-test-suite.yml b/.github/workflows/platform-test-suite.yml index 2c922afa115..4082f4c07a7 100644 --- a/.github/workflows/platform-test-suite.yml +++ b/.github/workflows/platform-test-suite.yml @@ -36,3 +36,5 @@ jobs: package: '@dashevo/platform-test-suite' skip-tests: true install-browsers: true + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/rs-drive-nodejs.yml b/.github/workflows/rs-drive-nodejs.yml index 2f3a86c164b..9473c6439da 100644 --- a/.github/workflows/rs-drive-nodejs.yml +++ b/.github/workflows/rs-drive-nodejs.yml @@ -37,3 +37,5 @@ jobs: uses: ./.github/workflows/js-checks.yml with: package: '@dashevo/rs-drive' + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/wallet-lib.yml b/.github/workflows/wallet-lib.yml index 1a3d18735d6..a035506f538 100644 --- a/.github/workflows/wallet-lib.yml +++ b/.github/workflows/wallet-lib.yml @@ -34,3 +34,5 @@ jobs: package: '@dashevo/wallet-lib' start-local-network: true install-browsers: true + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/wasm-dpp.yml b/.github/workflows/wasm-dpp.yml index dc90a26d047..c4c528a2146 100644 --- a/.github/workflows/wasm-dpp.yml +++ b/.github/workflows/wasm-dpp.yml @@ -31,6 +31,8 @@ jobs: with: package: '@dashevo/wasm-dpp' install-browsers: true + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} rs-checks: name: Rust