From 650a3bd1dfc69439923fcd0ce8de755d7fa212b4 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:14:15 +0100 Subject: [PATCH 01/17] sccache ttest --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 81b821c93c..8affc77840 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,6 +17,9 @@ jobs: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable + + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 - name: Cache uses: actions/cache@v3 From d5ca55a3c8b014496fcdb9bc3edf632984fd84bf Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Tue, 26 Dec 2023 23:21:44 +0100 Subject: [PATCH 02/17] random thing --- .github/workflows/ci.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8affc77840..8bf033d167 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,5 @@ name: Tests +uses: mozilla-actions/sccache-action@v0.0.3 on: [push, pull_request] @@ -17,9 +18,6 @@ jobs: - name: Install stable toolchain uses: dtolnay/rust-toolchain@stable - - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.3 - name: Cache uses: actions/cache@v3 From 98b5b02ed94a428c443d1af808dfbf42fd19e5ef Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 20:55:11 +0100 Subject: [PATCH 03/17] lets try seq workflow --- .github/workflows/ci.yaml | 222 +++++++++++++++++--------------------- 1 file changed, 98 insertions(+), 124 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8bf033d167..ffc1dd1587 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,37 +4,8 @@ uses: mozilla-actions/sccache-action@v0.0.3 on: [push, pull_request] jobs: - check: - name: Check - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install stable toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Run cargo check - run: cargo check --tests --workspace --benches - - test: - name: Test Suite + clean-up-start: # clean up before and after the test suite + name: Clean Up start # runs-on: ${{ matrix.os }} runs-on: ubuntu-latest strategy: @@ -80,9 +51,55 @@ jobs: swap-storage: true + set-up: + name: Set Up + needs: clean-up-start + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: - name: Checkout sources uses: actions/checkout@v3 + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install stable toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - name: Cache + - uses: Swatinem/rust-cache@v2 + + - name: Configure sccache env var and set build profile to ephemeral build + - run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo “SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV + + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 + + check: + name: Check + runs-on: ubuntu-latest # Okay to just use one here + needs: set-up + steps: + - name: Run cargo check + run: cargo check --tests --workspace --benches + + tests: + name: Test Suite + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Fix CRLF on Windows if: runner.os == 'Windows' run: git config --global core.autocrlf false @@ -91,27 +108,10 @@ jobs: uses: arduino/setup-protoc@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install stable toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Set up cache - uses: Swatinem/rust-cache@v2 - name: Install cargo-nextest run: cargo install cargo-nextest - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Run cargo build with devnet-prealloc feature run: cargo build --release --features devnet-prealloc --workspace --all --tests --benches @@ -178,31 +178,8 @@ jobs: lints: name: Lints - runs-on: ubuntu-latest + runs-on: ubuntu-latest # one os is okay for lints steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install stable toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt, clippy - - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run cargo fmt run: cargo fmt --all -- --check @@ -215,13 +192,6 @@ jobs: name: Check Wasm32 runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install llvm id: install_llvm @@ -245,26 +215,11 @@ jobs: sudo apt-get update sudo apt install -y gcc-multilib - - name: Install stable toolchain - if: steps.install_llvm.outcome == 'success' && steps.install_llvm.conclusion == 'success' - uses: dtolnay/rust-toolchain@stable - - name: Add wasm32 target run: rustup target add wasm32-unknown-unknown - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - # append here any new wasm32 crate not already covered by the existing checks - + - name: Run cargo check of kaspa-wrpc-wasm for wasm32 target run: cargo clippy -p kaspa-wrpc-wasm --target wasm32-unknown-unknown @@ -275,16 +230,10 @@ jobs: run: cargo clippy -p kaspa-wasm --target wasm32-unknown-unknown build-wasm32: + needs: set-up name: Build Wasm32 runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install llvm id: install_llvm @@ -333,31 +282,11 @@ jobs: run: cd wasm && wasm-pack build --target nodejs --out-dir nodejs/kaspa --features full build-release: + needs: [set-up, build-wasm32, check-wasm32, tests, lints, build-release, check] name: Build Ubuntu Release runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install stable toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - + - name: Install zig if: runner.os == 'Linux' uses: goto-bus-stop/setup-zig@v2 # needed for cargo-zigbuild @@ -368,3 +297,48 @@ jobs: run: | cargo install cargo-zigbuild cargo --verbose zigbuild --bin kaspad --bin simpa --bin rothschild --release --target x86_64-unknown-linux-gnu.2.27 # Use an older glibc version + + clean-up-end: # clean up before and after the test suite + needs: set-up + name: Clean Up end + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + # Clean unnecessary files to save disk space + - name: clean unnecessary files to save space + run: | + docker rmi `docker images -q` + sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d + sudo apt -y autoremove --purge + sudo apt -y autoclean + sudo apt clean + rm --recursive --force "$AGENT_TOOLSDIRECTORY" + df -h + + # remove large packages manually (all but llvm) + sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y 'php.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y 'php.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mongodb-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y google-cloud-sdk --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-sdk --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y google-cloud-cli --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-cli --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..." + sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..." + df -h + + # Free up disk space on Ubuntu + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: false + + # large packages, except llvm, are removed manually during the previous step + # see: https://github.com/jlumbroso/free-disk-space/issues/6 + # TODO: use the discussed whitelist feature when available + large-packages: false + + swap-storage: true From 690831f07f65a0410e6284d2e052436c9bf25d1f Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:05:23 +0100 Subject: [PATCH 04/17] update --- .github/workflows/ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ffc1dd1587..c75e015d00 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,5 +1,4 @@ name: Tests -uses: mozilla-actions/sccache-action@v0.0.3 on: [push, pull_request] From c7e8d48d4be32ec8f1e92fd8c7988c323bf18bd0 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:11:35 +0100 Subject: [PATCH 05/17] small change.. --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c75e015d00..e017175158 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -75,12 +75,13 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Configure sccache env var and set build profile to ephemeral build - - run: | + run: | echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV echo “SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 + check: name: Check From 5e8b081cd6d6c2db7eab80b77d068cc1593e0b06 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:17:20 +0100 Subject: [PATCH 06/17] fix --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e017175158..fc744fa151 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -77,7 +77,7 @@ jobs: - name: Configure sccache env var and set build profile to ephemeral build run: | echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo “SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV + echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 From 37188472110ba080b34b090e4aba727dfdf3cf27 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:21:28 +0100 Subject: [PATCH 07/17] fix2 --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fc744fa151..f6c4c40c83 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -74,10 +74,10 @@ jobs: - name: Cache - uses: Swatinem/rust-cache@v2 - - name: Configure sccache env var and set build profile to ephemeral build - run: | - echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV + - name: Configure sccache env var + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 From d9712ab459e28714190f21eac16a608ea53c60fd Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:30:14 +0100 Subject: [PATCH 08/17] maybe fixed --- .github/workflows/ci.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f6c4c40c83..7d2874816e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,12 +72,12 @@ jobs: components: rustfmt, clippy - name: Cache - - uses: Swatinem/rust-cache@v2 + uses: Swatinem/rust-cache@v2 - name: Configure sccache env var - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 @@ -96,8 +96,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: fail-fast: false - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] steps: - name: Fix CRLF on Windows @@ -282,7 +282,7 @@ jobs: run: cd wasm && wasm-pack build --target nodejs --out-dir nodejs/kaspa --features full build-release: - needs: [set-up, build-wasm32, check-wasm32, tests, lints, build-release, check] + needs: [set-up, build-wasm32, check-wasm32, tests, lints, check] name: Build Ubuntu Release runs-on: ubuntu-latest steps: From f53e7d7dce0e488536dfbaad94bd6792d854c5d0 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:41:03 +0100 Subject: [PATCH 09/17] update --- .github/workflows/ci.yaml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7d2874816e..ed233da9dd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -85,14 +85,15 @@ jobs: check: name: Check - runs-on: ubuntu-latest # Okay to just use one here needs: set-up + runs-on: ubuntu-latest # Okay to just use one here steps: - name: Run cargo check run: cargo check --tests --workspace --benches tests: name: Test Suite + needs: set-up runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -178,6 +179,7 @@ jobs: lints: name: Lints + needs: set-up runs-on: ubuntu-latest # one os is okay for lints steps: @@ -190,6 +192,7 @@ jobs: check-wasm32: name: Check Wasm32 + needs: set-up runs-on: ubuntu-latest steps: @@ -230,8 +233,8 @@ jobs: run: cargo clippy -p kaspa-wasm --target wasm32-unknown-unknown build-wasm32: - needs: set-up name: Build Wasm32 + needs: set-up runs-on: ubuntu-latest steps: @@ -282,9 +285,13 @@ jobs: run: cd wasm && wasm-pack build --target nodejs --out-dir nodejs/kaspa --features full build-release: - needs: [set-up, build-wasm32, check-wasm32, tests, lints, check] - name: Build Ubuntu Release - runs-on: ubuntu-latest + needs: set-up + name: Release + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] steps: - name: Install zig @@ -299,11 +306,13 @@ jobs: cargo --verbose zigbuild --bin kaspad --bin simpa --bin rothschild --release --target x86_64-unknown-linux-gnu.2.27 # Use an older glibc version clean-up-end: # clean up before and after the test suite - needs: set-up + needs: [set-up, build-wasm32, check-wasm32, tests, lints, check] name: Clean Up end - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] steps: # Clean unnecessary files to save disk space - name: clean unnecessary files to save space From 6573431cf3842d0773629ce0128a8c5bae4fb459 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 21:58:42 +0100 Subject: [PATCH 10/17] update --- .github/workflows/ci.yaml | 61 +++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ed233da9dd..a3c54fdfc4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: Tests on: [push, pull_request] jobs: - clean-up-start: # clean up before and after the test suite + clean-up-start: # clean up before the jobs name: Clean Up start # runs-on: ${{ matrix.os }} runs-on: ubuntu-latest @@ -101,9 +101,19 @@ jobs: os: [ ubuntu-latest, macos-latest, windows-latest ] steps: - - name: Fix CRLF on Windows - if: runner.os == 'Windows' - run: git config --global core.autocrlf false + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Cache + uses: Swatinem/rust-cache@v2 + + - name: Configure sccache env var + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV + + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.4 - name: Install Protoc uses: arduino/setup-protoc@v1 @@ -113,6 +123,10 @@ jobs: - name: Install cargo-nextest run: cargo install cargo-nextest + - name: Fix CRLF on Windows + if: runner.os == 'Windows' + run: git config --global core.autocrlf false + - name: Run cargo build with devnet-prealloc feature run: cargo build --release --features devnet-prealloc --workspace --all --tests --benches @@ -127,6 +141,10 @@ jobs: - name: Run cargo doc tests with features=no-asm on kaspa-hashes run: cargo test --doc --release -p kaspa-hashes --features=no-asm + + - name: Run sccache stat for check + shell: bash + run: ${SCCACHE_PATH} --show-stats # test-release: # name: Test Suite Release @@ -293,6 +311,25 @@ jobs: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] steps: + + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Cache + uses: Swatinem/rust-cache@v2 + + - name: Configure sccache env var + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV + + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.4 + + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install zig if: runner.os == 'Linux' @@ -305,8 +342,20 @@ jobs: cargo install cargo-zigbuild cargo --verbose zigbuild --bin kaspad --bin simpa --bin rothschild --release --target x86_64-unknown-linux-gnu.2.27 # Use an older glibc version - clean-up-end: # clean up before and after the test suite - needs: [set-up, build-wasm32, check-wasm32, tests, lints, check] + - name: Build on MacOS + if: runner.os == 'MacOS' + run: cargo build --release --target x86_64-apple-darwin + + - name: Build on Windows + if: runner.os == 'Windows' + run: cargo build --release --target x86_64-pc-windows-msvc + + - name: Run sccache stat for check + shell: bash + run: ${SCCACHE_PATH} --show-stats + + clean-up-end: # clean up after the jobs + needs: [set-up, build-wasm32, check-wasm32, tests, lints, check, build-release] name: Clean Up end runs-on: ${{ matrix.os }} strategy: From 8a042ebf7854aa0ecd2832142361ae4c45cecc13 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:03:21 +0100 Subject: [PATCH 11/17] fix version --- .github/workflows/ci.yaml | 47 ++++----------------------------------- 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a3c54fdfc4..4e7bbb84de 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,44 +48,10 @@ jobs: # TODO: use the discussed whitelist feature when available large-packages: false - swap-storage: true - - set-up: - name: Set Up - needs: clean-up-start - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout sources - uses: actions/checkout@v3 - - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install stable toolchain - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt, clippy - - - name: Cache - uses: Swatinem/rust-cache@v2 - - - name: Configure sccache env var - run: | - echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV - - - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.3 - + swap-storage: true check: name: Check - needs: set-up runs-on: ubuntu-latest # Okay to just use one here steps: - name: Run cargo check @@ -93,7 +59,6 @@ jobs: tests: name: Test Suite - needs: set-up runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -113,7 +78,7 @@ jobs: echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.4 + uses: mozilla-actions/sccache-action@v0.0.3 - name: Install Protoc uses: arduino/setup-protoc@v1 @@ -197,7 +162,6 @@ jobs: lints: name: Lints - needs: set-up runs-on: ubuntu-latest # one os is okay for lints steps: @@ -210,7 +174,6 @@ jobs: check-wasm32: name: Check Wasm32 - needs: set-up runs-on: ubuntu-latest steps: @@ -252,7 +215,6 @@ jobs: build-wasm32: name: Build Wasm32 - needs: set-up runs-on: ubuntu-latest steps: @@ -303,7 +265,6 @@ jobs: run: cd wasm && wasm-pack build --target nodejs --out-dir nodejs/kaspa --features full build-release: - needs: set-up name: Release runs-on: ${{ matrix.os }} strategy: @@ -324,7 +285,7 @@ jobs: echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.4 + uses: mozilla-actions/sccache-action@v0.0.3 - name: Install Protoc uses: arduino/setup-protoc@v1 @@ -355,7 +316,7 @@ jobs: run: ${SCCACHE_PATH} --show-stats clean-up-end: # clean up after the jobs - needs: [set-up, build-wasm32, check-wasm32, tests, lints, check, build-release] + needs: [build-wasm32, check-wasm32, tests, lints, check, build-release] name: Clean Up end runs-on: ${{ matrix.os }} strategy: From d09690ebbd48763c66a6d579361ce19407639b27 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:09:09 +0100 Subject: [PATCH 12/17] update again --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4e7bbb84de..da1386e824 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -305,11 +305,11 @@ jobs: - name: Build on MacOS if: runner.os == 'MacOS' - run: cargo build --release --target x86_64-apple-darwin + run: cargo build --release - name: Build on Windows if: runner.os == 'Windows' - run: cargo build --release --target x86_64-pc-windows-msvc + run: cargo build --release - name: Run sccache stat for check shell: bash From 629ff4b8226102711ce884ecc8c9c0372f20f2bc Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:29:47 +0100 Subject: [PATCH 13/17] another update --- .github/workflows/ci.yaml | 75 ++++++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index da1386e824..cf3053c4fc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -48,16 +48,48 @@ jobs: # TODO: use the discussed whitelist feature when available large-packages: false - swap-storage: true + swap-storage: true + + setup-toolchain: + needs: [clean-up-start] + name: Setup Rust + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} check: + needs: [setup-toolchain] name: Check runs-on: ubuntu-latest # Okay to just use one here steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Cache + uses: Swatinem/rust-cache@v2 + + - name: Configure sccache env var + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV + + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 + - name: Run cargo check run: cargo check --tests --workspace --benches tests: + needs: [setup-toolchain] name: Test Suite runs-on: ${{ matrix.os }} strategy: @@ -79,11 +111,6 @@ jobs: - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 - - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install cargo-nextest run: cargo install cargo-nextest @@ -161,10 +188,14 @@ jobs: # args: -p hashes --features=no-asm --benches --release lints: + needs: [setup-toolchain] name: Lints runs-on: ubuntu-latest # one os is okay for lints steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Run cargo fmt run: cargo fmt --all -- --check @@ -173,10 +204,14 @@ jobs: check-wasm32: + needs: [setup-toolchain] name: Check Wasm32 runs-on: ubuntu-latest steps: + - name: Checkout sources + uses: actions/checkout@v3 + - name: Install llvm id: install_llvm continue-on-error: true @@ -214,10 +249,22 @@ jobs: run: cargo clippy -p kaspa-wasm --target wasm32-unknown-unknown build-wasm32: + needs: [setup-toolchain] name: Build Wasm32 runs-on: ubuntu-latest steps: + - name: Cache + uses: Swatinem/rust-cache@v2 + + - name: Configure sccache env var + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_DIR=$HOME/.cache/sccache" >> $GITHUB_ENV + + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.3 + - name: Install llvm id: install_llvm continue-on-error: true @@ -240,31 +287,17 @@ jobs: sudo apt-get update sudo apt install -y gcc-multilib - - name: Install stable toolchain - if: steps.install_llvm.outcome == 'success' && steps.install_llvm.conclusion == 'success' - uses: dtolnay/rust-toolchain@stable - - name: Install wasm-pack run: cargo install wasm-pack - name: Add wasm32 target run: rustup target add wasm32-unknown-unknown - - name: Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Build wasm pack for nodejs run: cd wasm && wasm-pack build --target nodejs --out-dir nodejs/kaspa --features full build-release: + needs: [setup-toolchain] name: Release runs-on: ${{ matrix.os }} strategy: From 30ef2b93a98ed2f2399489ff7d751b740f58e01f Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:31:19 +0100 Subject: [PATCH 14/17] clean up all os runners --- .github/workflows/ci.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cf3053c4fc..852e291be5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,12 +5,11 @@ on: [push, pull_request] jobs: clean-up-start: # clean up before the jobs name: Clean Up start - # runs-on: ${{ matrix.os }} - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: fail-fast: false - # matrix: - # os: [ ubuntu-latest, macos-latest, windows-latest ] + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] steps: # Clean unnecessary files to save disk space - name: clean unnecessary files to save space From 4d6a12e6308e85b4bae3a3c6d9f6e91b15732fb3 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:38:28 +0100 Subject: [PATCH 15/17] clean up only ubuntu --- .github/workflows/ci.yaml | 52 ++------------------------------------- 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 852e291be5..643e57b1df 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,11 +5,9 @@ on: [push, pull_request] jobs: clean-up-start: # clean up before the jobs name: Clean Up start - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] steps: # Clean unnecessary files to save disk space - name: clean unnecessary files to save space @@ -346,50 +344,4 @@ jobs: - name: Run sccache stat for check shell: bash run: ${SCCACHE_PATH} --show-stats - - clean-up-end: # clean up after the jobs - needs: [build-wasm32, check-wasm32, tests, lints, check, build-release] - name: Clean Up end - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - steps: - # Clean unnecessary files to save disk space - - name: clean unnecessary files to save space - run: | - docker rmi `docker images -q` - sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d - sudo apt -y autoremove --purge - sudo apt -y autoclean - sudo apt clean - rm --recursive --force "$AGENT_TOOLSDIRECTORY" - df -h - - # remove large packages manually (all but llvm) - sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..." - sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y 'php.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y 'php.*' --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mongodb-.*' --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y google-cloud-sdk --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-sdk --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y google-cloud-cli --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-cli --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..." - sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..." - df -h - - # Free up disk space on Ubuntu - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # This might remove tools that are actually needed, if set to "true" but frees about 6 GB - tool-cache: false - - # large packages, except llvm, are removed manually during the previous step - # see: https://github.com/jlumbroso/free-disk-space/issues/6 - # TODO: use the discussed whitelist feature when available - large-packages: false - - swap-storage: true + \ No newline at end of file From c0c1736e97085b6e9e4f86a3df8cd79e737df818 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Wed, 27 Dec 2023 22:52:42 +0100 Subject: [PATCH 16/17] another push --- .github/workflows/ci.yaml | 72 ++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 643e57b1df..2fbd5a12a3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -46,28 +46,21 @@ jobs: large-packages: false swap-storage: true - - setup-toolchain: - needs: [clean-up-start] - name: Setup Rust - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + + check: + needs: [clean-up-start] + name: Check + runs-on: ubuntu-latest # Okay to just use one here steps: + - name: Install Rust uses: dtolnay/rust-toolchain@stable + - name: Install Protoc uses: arduino/setup-protoc@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - check: - needs: [setup-toolchain] - name: Check - runs-on: ubuntu-latest # Okay to just use one here - steps: - name: Checkout sources uses: actions/checkout@v3 @@ -86,7 +79,7 @@ jobs: run: cargo check --tests --workspace --benches tests: - needs: [setup-toolchain] + needs: [clean-up-start] name: Test Suite runs-on: ${{ matrix.os }} strategy: @@ -95,6 +88,14 @@ jobs: os: [ ubuntu-latest, macos-latest, windows-latest ] steps: + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout sources uses: actions/checkout@v3 @@ -185,11 +186,19 @@ jobs: # args: -p hashes --features=no-asm --benches --release lints: - needs: [setup-toolchain] + needs: [clean-up-start] name: Lints runs-on: ubuntu-latest # one os is okay for lints steps: + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout sources uses: actions/checkout@v3 @@ -201,11 +210,19 @@ jobs: check-wasm32: - needs: [setup-toolchain] + needs: [clean-up-start] name: Check Wasm32 runs-on: ubuntu-latest steps: + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout sources uses: actions/checkout@v3 @@ -246,11 +263,19 @@ jobs: run: cargo clippy -p kaspa-wasm --target wasm32-unknown-unknown build-wasm32: - needs: [setup-toolchain] + needs: [clean-up-start] name: Build Wasm32 runs-on: ubuntu-latest steps: + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - name: Cache uses: Swatinem/rust-cache@v2 @@ -294,7 +319,7 @@ jobs: run: cd wasm && wasm-pack build --target nodejs --out-dir nodejs/kaspa --features full build-release: - needs: [setup-toolchain] + needs: [clean-up-start] name: Release runs-on: ${{ matrix.os }} strategy: @@ -302,6 +327,14 @@ jobs: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] steps: + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - name: Install Protoc + uses: arduino/setup-protoc@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Checkout sources uses: actions/checkout@v3 @@ -344,4 +377,3 @@ jobs: - name: Run sccache stat for check shell: bash run: ${SCCACHE_PATH} --show-stats - \ No newline at end of file From 43811dea60149b5bdff6b5d4b83b83f79fd6cee5 Mon Sep 17 00:00:00 2001 From: D-Stacks <78099568+D-Stacks@users.noreply.github.com> Date: Thu, 28 Dec 2023 01:18:20 +0100 Subject: [PATCH 17/17] change --- .github/workflows/ci.yaml | 131 +++++++++++++++++++++++--------------- 1 file changed, 81 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2fbd5a12a3..59c20a0416 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,52 +3,8 @@ name: Tests on: [push, pull_request] jobs: - clean-up-start: # clean up before the jobs - name: Clean Up start - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - # Clean unnecessary files to save disk space - - name: clean unnecessary files to save space - run: | - docker rmi `docker images -q` - sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d - sudo apt -y autoremove --purge - sudo apt -y autoclean - sudo apt clean - rm --recursive --force "$AGENT_TOOLSDIRECTORY" - df -h - - # remove large packages manually (all but llvm) - sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..." - sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y 'php.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y 'php.*' --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mongodb-.*' --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y google-cloud-sdk --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-sdk --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get remove -y google-cloud-cli --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-cli --fix-missing] failed to complete successfully. Proceeding..." - sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..." - sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..." - df -h - - # Free up disk space on Ubuntu - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@main - with: - # This might remove tools that are actually needed, if set to "true" but frees about 6 GB - tool-cache: false - - # large packages, except llvm, are removed manually during the previous step - # see: https://github.com/jlumbroso/free-disk-space/issues/6 - # TODO: use the discussed whitelist feature when available - large-packages: false - - swap-storage: true check: - needs: [clean-up-start] name: Check runs-on: ubuntu-latest # Okay to just use one here steps: @@ -79,7 +35,6 @@ jobs: run: cargo check --tests --workspace --benches tests: - needs: [clean-up-start] name: Test Suite runs-on: ${{ matrix.os }} strategy: @@ -88,6 +43,47 @@ jobs: os: [ ubuntu-latest, macos-latest, windows-latest ] steps: + # Clean unnecessary files to save disk space + - name: clean unnecessary files to save space + if: runner.os == 'Linux' + run: | + docker rmi `docker images -q` + sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d + sudo apt -y autoremove --purge + sudo apt -y autoclean + sudo apt clean + rm --recursive --force "$AGENT_TOOLSDIRECTORY" + df -h + + # remove large packages manually (all but llvm) + sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y 'php.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y 'php.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mongodb-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y google-cloud-sdk --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-sdk --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y google-cloud-cli --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-cli --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..." + sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..." + df -h + + # Free up disk space on Ubuntu + - name: Free Disk Space (Ubuntu) + if: runner.os == 'Linux' + uses: jlumbroso/free-disk-space@main + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: false + + # large packages, except llvm, are removed manually during the previous step + # see: https://github.com/jlumbroso/free-disk-space/issues/6 + # TODO: use the discussed whitelist feature when available + large-packages: false + + swap-storage: true + + - name: Install Rust uses: dtolnay/rust-toolchain@stable @@ -186,7 +182,6 @@ jobs: # args: -p hashes --features=no-asm --benches --release lints: - needs: [clean-up-start] name: Lints runs-on: ubuntu-latest # one os is okay for lints steps: @@ -210,7 +205,6 @@ jobs: check-wasm32: - needs: [clean-up-start] name: Check Wasm32 runs-on: ubuntu-latest steps: @@ -263,7 +257,6 @@ jobs: run: cargo clippy -p kaspa-wasm --target wasm32-unknown-unknown build-wasm32: - needs: [clean-up-start] name: Build Wasm32 runs-on: ubuntu-latest steps: @@ -319,14 +312,52 @@ jobs: run: cd wasm && wasm-pack build --target nodejs --out-dir nodejs/kaspa --features full build-release: - needs: [clean-up-start] name: Release runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] + os: [ ubuntu-latest ] steps: + # Clean unnecessary files to save disk space + - name: clean unnecessary files to save space + if: runner.os == 'Linux' + run: | + docker rmi `docker images -q` + sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/sudo apt/sources.list.d + sudo apt -y autoremove --purge + sudo apt -y autoclean + sudo apt clean + rm --recursive --force "$AGENT_TOOLSDIRECTORY" + df -h + + # remove large packages manually (all but llvm) + sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y 'php.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y 'php.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^mongodb-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mongodb-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y '^mysql-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^mysql-.*' --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || echo "::warning::The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y google-cloud-sdk --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-sdk --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get remove -y google-cloud-cli --fix-missing || echo "::debug::The command [sudo apt-get remove -y google-cloud-cli --fix-missing] failed to complete successfully. Proceeding..." + sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..." + sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..." + df -h + + # Free up disk space on Ubuntu + - name: Free Disk Space (Ubuntu) + if: runner.os == 'Linux' + uses: jlumbroso/free-disk-space@main + with: + # This might remove tools that are actually needed, if set to "true" but frees about 6 GB + tool-cache: false + + # large packages, except llvm, are removed manually during the previous step + # see: https://github.com/jlumbroso/free-disk-space/issues/6 + # TODO: use the discussed whitelist feature when available + large-packages: false + + swap-storage: true - name: Install Rust uses: dtolnay/rust-toolchain@stable