From fbfec25228227fef2715e1fe4e0b6c188781f17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sat, 30 Sep 2023 15:30:09 +0200 Subject: [PATCH 1/5] Remove nightly toolchain from contracts and nightly build Building with the beta toolchain should be enough to alert us to impending compiler and clippy changes. --- .../workflows/ci-contracts-matrix-includes.json | 6 +----- .github/workflows/ci-contracts.yml | 2 -- .github/workflows/nightly_build.yml | 2 +- .../workflows/nightly_build_matrix_includes.json | 16 ---------------- 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci-contracts-matrix-includes.json b/.github/workflows/ci-contracts-matrix-includes.json index 134938eb53..8ef3e79912 100644 --- a/.github/workflows/ci-contracts-matrix-includes.json +++ b/.github/workflows/ci-contracts-matrix-includes.json @@ -6,9 +6,5 @@ { "rust":"beta", "runOnEvent":"pull_request" - }, - { - "rust":"nightly", - "runOnEvent":"pull_request" } -] \ No newline at end of file +] diff --git a/.github/workflows/ci-contracts.yml b/.github/workflows/ci-contracts.yml index 491dbdb105..b814f87e8a 100644 --- a/.github/workflows/ci-contracts.yml +++ b/.github/workflows/ci-contracts.yml @@ -27,7 +27,6 @@ jobs: # since it's going to be compiled into wasm, there's absolutely # no point in running CI on different OS-es runs-on: ubuntu-20.04 - continue-on-error: ${{ matrix.rust == 'nightly' }} needs: matrix_prep strategy: fail-fast: false @@ -61,7 +60,6 @@ jobs: args: --manifest-path contracts/Cargo.toml --all -- --check - uses: actions-rs/cargo@v1 - if: ${{ matrix.rust != 'nightly' }} with: command: clippy args: --lib --manifest-path contracts/Cargo.toml --workspace --all-targets -- -D warnings diff --git a/.github/workflows/nightly_build.yml b/.github/workflows/nightly_build.yml index f126348b45..282be76778 100644 --- a/.github/workflows/nightly_build.yml +++ b/.github/workflows/nightly_build.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: ${{fromJson(needs.matrix_prep.outputs.matrix)}} runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.rust == 'nightly' || matrix.rust == 'beta' || matrix.rust == 'stable' }} + continue-on-error: ${{ matrix.rust == 'beta' || matrix.rust == 'stable' }} steps: - name: Install Dependencies (Linux) run: sudo apt-get update && sudo apt-get install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools protobuf-compiler diff --git a/.github/workflows/nightly_build_matrix_includes.json b/.github/workflows/nightly_build_matrix_includes.json index b9a500aaf0..8fbbb2e043 100644 --- a/.github/workflows/nightly_build_matrix_includes.json +++ b/.github/workflows/nightly_build_matrix_includes.json @@ -30,21 +30,5 @@ "os":"custom-runner-mac-m1", "rust":"beta", "runOnEvent":"schedule" - }, - - { - "os":"custom-linux", - "rust":"nightly", - "runOnEvent":"schedule" - }, - { - "os":"windows10", - "rust":"nightly", - "runOnEvent":"schedule" - }, - { - "os":"custom-runner-mac-m1", - "rust":"nightly", - "runOnEvent":"schedule" } ] From bd75c9c78d9af772624da391afe5bce0988a8730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sat, 30 Sep 2023 15:34:05 +0200 Subject: [PATCH 2/5] ci: disable sccache sccache keeps randomly failing, try disabling to see the impact on CI build times --- .github/workflows/ci-build.yml | 4 ++-- .github/workflows/ci-nym-connect-desktop-rust.yml | 4 ++-- .github/workflows/ci-nym-wallet-rust.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 09a4df9ba1..31afba188d 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -42,8 +42,8 @@ jobs: build: runs-on: [ self-hosted, custom-linux ] # Enable sccache via environment variable - env: - RUSTC_WRAPPER: /home/ubuntu/.cargo/bin/sccache + # env: + # RUSTC_WRAPPER: /home/ubuntu/.cargo/bin/sccache steps: - name: Install Dependencies (Linux) run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libudev-dev squashfs-tools protobuf-compiler diff --git a/.github/workflows/ci-nym-connect-desktop-rust.yml b/.github/workflows/ci-nym-connect-desktop-rust.yml index 93cdfa0aeb..ed63542448 100644 --- a/.github/workflows/ci-nym-connect-desktop-rust.yml +++ b/.github/workflows/ci-nym-connect-desktop-rust.yml @@ -25,8 +25,8 @@ on: jobs: build: runs-on: [self-hosted, custom-linux] - env: - RUSTC_WRAPPER: /home/ubuntu/.cargo/bin/sccache + # env: + # RUSTC_WRAPPER: /home/ubuntu/.cargo/bin/sccache steps: - name: Install Dependencies (Linux) run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools libayatana-appindicator3-dev diff --git a/.github/workflows/ci-nym-wallet-rust.yml b/.github/workflows/ci-nym-wallet-rust.yml index fa32b97b37..9a207334bd 100644 --- a/.github/workflows/ci-nym-wallet-rust.yml +++ b/.github/workflows/ci-nym-wallet-rust.yml @@ -17,8 +17,8 @@ on: jobs: build: runs-on: [ self-hosted, custom-linux ] - env: - RUSTC_WRAPPER: /home/ubuntu/.cargo/bin/sccache + # env: + # RUSTC_WRAPPER: /home/ubuntu/.cargo/bin/sccache steps: - name: Install Dependencies (Linux) run: sudo apt-get update && sudo apt-get -y install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev squashfs-tools From a450e2910ff4b9010455b0fd50e23fe2a6d0ee40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sat, 30 Sep 2023 15:53:42 +0200 Subject: [PATCH 3/5] Add workflow_dispatch to nightly build --- .github/workflows/nightly_build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nightly_build.yml b/.github/workflows/nightly_build.yml index 282be76778..c7db60e201 100644 --- a/.github/workflows/nightly_build.yml +++ b/.github/workflows/nightly_build.yml @@ -1,6 +1,7 @@ name: Nightly builds on: + workflow_dispatch: schedule: - cron: '14 1 * * *' jobs: From a67a9c4b32c382aca5cd1e945412225a1201dc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sat, 30 Sep 2023 16:50:54 +0200 Subject: [PATCH 4/5] Try adding conditional to avoid duplicate builds --- .github/workflows/ci-build-upload-binaries.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-build-upload-binaries.yml b/.github/workflows/ci-build-upload-binaries.yml index 9083259d0f..e99eaf82bd 100644 --- a/.github/workflows/ci-build-upload-binaries.yml +++ b/.github/workflows/ci-build-upload-binaries.yml @@ -42,6 +42,8 @@ jobs: platform: [ubuntu-20.04] runs-on: ${{ matrix.platform }} + # a push event from the origin repo, or a PR from external repo + if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'nymtech/nym' }} steps: - uses: actions/checkout@v3 From e4a2c639fce22a76b8c0aadb813e0d6d3e43e18e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20H=C3=A4ggblad?= Date: Sat, 30 Sep 2023 17:05:46 +0200 Subject: [PATCH 5/5] Add names to contract job steps --- .github/workflows/ci-contracts.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-contracts.yml b/.github/workflows/ci-contracts.yml index b814f87e8a..8118ccac74 100644 --- a/.github/workflows/ci-contracts.yml +++ b/.github/workflows/ci-contracts.yml @@ -34,7 +34,8 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Setup rust + uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.rust }} @@ -42,24 +43,28 @@ jobs: override: true components: rustfmt, clippy - - uses: actions-rs/cargo@v1 + - name: Build contracts + uses: actions-rs/cargo@v1 env: RUSTFLAGS: '-C link-arg=-s' with: command: build args: --manifest-path contracts/Cargo.toml --workspace --lib --target wasm32-unknown-unknown - - uses: actions-rs/cargo@v1 + - name: Run unit tests + uses: actions-rs/cargo@v1 with: command: test args: --lib --manifest-path contracts/Cargo.toml - - uses: actions-rs/cargo@v1 + - name: Check formatting + uses: actions-rs/cargo@v1 with: command: fmt args: --manifest-path contracts/Cargo.toml --all -- --check - - uses: actions-rs/cargo@v1 + - name: Run clippy + uses: actions-rs/cargo@v1 with: command: clippy args: --lib --manifest-path contracts/Cargo.toml --workspace --all-targets -- -D warnings