From ec34450afc992243cfcb339150766e960808419c Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Tue, 6 Jun 2023 14:42:14 +0300 Subject: [PATCH 01/21] test: nixified ci --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f85287f00..bd21e0e9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,11 +70,14 @@ jobs: - name: Init cache uses: Swatinem/rust-cache@v2 - - name: Install Fuel toolchain - uses: FuelLabs/action-fuel-toolchain@v0.6.0 + - name: Install fuel toolchain + uses: cachix/install-nix-action@v20 with: - toolchain: latest - date: 2023-04-12 + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + extra-substituters = https://fuellabs.cachix.org + extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= + - run: nix shell github:fuellabs/fuel.nix#forc-0-39-0 - name: Check Sway formatting run: | From b75b5061c2cfafcf99f989b764693ffbebe70b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaya=20G=C3=B6kalp?= Date: Thu, 8 Jun 2023 22:14:32 +0300 Subject: [PATCH 02/21] Update .github/workflows/ci.yml Co-authored-by: Sophie Dankel <47993817+sdankel@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd21e0e9c..697e045e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,8 +75,8 @@ jobs: with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | - extra-substituters = https://fuellabs.cachix.org - extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= + substituters = https://fuellabs.cachix.org + trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= - run: nix shell github:fuellabs/fuel.nix#forc-0-39-0 - name: Check Sway formatting From cc4bcdd66f5e14ec216cf27b08dfd3a610cd3c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaya=20G=C3=B6kalp?= Date: Thu, 8 Jun 2023 22:23:02 +0300 Subject: [PATCH 03/21] Update .github/workflows/ci.yml Co-authored-by: Sophie Dankel <47993817+sdankel@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 697e045e6..bd21e0e9c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,8 +75,8 @@ jobs: with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | - substituters = https://fuellabs.cachix.org - trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= + extra-substituters = https://fuellabs.cachix.org + extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= - run: nix shell github:fuellabs/fuel.nix#forc-0-39-0 - name: Check Sway formatting From c8315b72814cb7a4869f39f5b071df228bb23a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaya=20G=C3=B6kalp?= Date: Thu, 8 Jun 2023 22:23:11 +0300 Subject: [PATCH 04/21] Update .github/workflows/ci.yml Co-authored-by: Sophie Dankel <47993817+sdankel@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd21e0e9c..cfdb16cb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Install fuel toolchain - uses: cachix/install-nix-action@v20 + uses: cachix/install-nix-action@v21 with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | From d949a19ca5f8d0ed4b9558ff7e3f8c961f67b57d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaya=20G=C3=B6kalp?= Date: Thu, 8 Jun 2023 23:39:53 +0300 Subject: [PATCH 05/21] Update .github/workflows/ci.yml Co-authored-by: Sophie Dankel <47993817+sdankel@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cfdb16cb5..0b51ffb1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: extra_nix_config: | extra-substituters = https://fuellabs.cachix.org extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= - - run: nix shell github:fuellabs/fuel.nix#forc-0-39-0 + - run: nix profile install github:fuellabs/fuel.nix#forc-0-39-0 - name: Check Sway formatting run: | From c4124ea1a32f97ecd66a539a713a0846772a6685 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Sun, 11 Jun 2023 21:36:20 +0300 Subject: [PATCH 06/21] chore: try caching --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b51ffb1f..49e61eb25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,17 +67,39 @@ jobs: toolchain: ${{ env.RUST_VERSION }} components: clippy, rustfmt - - name: Init cache + - name: Init rust cache uses: Swatinem/rust-cache@v2 + - name: Cache nix-cache locally + id: cache-nix + uses: actions/cache@v2.1.0 + with: + # See https://stackoverflow.com/questions/59269850. + path: | + ~/nix/store + ~/nix/bin + # Using number to enforce fresh cache. + key: ${{ runner.os }}-15 + - name: Install fuel toolchain + env: + CACHE_HIT: ${{ steps.cache-nix.outputs.cache-hit }} uses: cachix/install-nix-action@v21 with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | extra-substituters = https://fuellabs.cachix.org extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= - - run: nix profile install github:fuellabs/fuel.nix#forc-0-39-0 + - run: | + NIX_STORE=/nix/store + if [[ "$CACHE_HIT" != 'true' ]]; then + nix profile install github:fuellabs/fuel.nix#fuel + mkdir -p ~/nix/store + sudo cp --force --recursive $NIX_STORE/* ~/nix/store/ + else + sudo mkdir -p $NIX_STORE + sudo cp --force --recursive ~/nix/store/* $NIX_STORE/ + fi - name: Check Sway formatting run: | From c5544100f58bf88124a2bd20f5e2c08250840a97 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Sun, 11 Jun 2023 21:49:31 +0300 Subject: [PATCH 07/21] try with beta-3 toolchain --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49e61eb25..83f804131 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,7 +93,7 @@ jobs: - run: | NIX_STORE=/nix/store if [[ "$CACHE_HIT" != 'true' ]]; then - nix profile install github:fuellabs/fuel.nix#fuel + nix profile install github:fuellabs/fuel.nix#fuel-beta-3 mkdir -p ~/nix/store sudo cp --force --recursive $NIX_STORE/* ~/nix/store/ else From 173e7f78d4023e2a8ea6e429c09a45c4b879c945 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Sun, 11 Jun 2023 21:55:37 +0300 Subject: [PATCH 08/21] pin to toolchain to match upstream --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83f804131..ff2ddc5aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,7 +93,7 @@ jobs: - run: | NIX_STORE=/nix/store if [[ "$CACHE_HIT" != 'true' ]]; then - nix profile install github:fuellabs/fuel.nix#fuel-beta-3 + nix profile install github:fuellabs/fuel.nix#fuel-nightly-2023-04-12 mkdir -p ~/nix/store sudo cp --force --recursive $NIX_STORE/* ~/nix/store/ else From 58bc56c272179b1eb5e7f1395f07054586ba4f27 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 00:06:04 +0300 Subject: [PATCH 09/21] chore: try different versions --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff2ddc5aa..1d20b767b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,7 +93,8 @@ jobs: - run: | NIX_STORE=/nix/store if [[ "$CACHE_HIT" != 'true' ]]; then - nix profile install github:fuellabs/fuel.nix#fuel-nightly-2023-04-12 + nix profile install github:fuellabs/fuel.nix#forc-nightly-2023-04-12 + nix profile install github:fuellabs/fuel.nix#forc-fmt-nightly-2023-04-12 mkdir -p ~/nix/store sudo cp --force --recursive $NIX_STORE/* ~/nix/store/ else From 70df253f3eb7e6fad3624cae2e34c2f26acad074 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 00:08:03 +0300 Subject: [PATCH 10/21] trying cache miss by chaning version --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d20b767b..49e61eb25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,8 +93,7 @@ jobs: - run: | NIX_STORE=/nix/store if [[ "$CACHE_HIT" != 'true' ]]; then - nix profile install github:fuellabs/fuel.nix#forc-nightly-2023-04-12 - nix profile install github:fuellabs/fuel.nix#forc-fmt-nightly-2023-04-12 + nix profile install github:fuellabs/fuel.nix#fuel mkdir -p ~/nix/store sudo cp --force --recursive $NIX_STORE/* ~/nix/store/ else From 705a8fe70dd152f833791a55c5bd53736c83ecaf Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 00:09:46 +0300 Subject: [PATCH 11/21] try complete cache hit From e67c52ff02f4e519b8ada81515540876ecadfb87 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 13:41:41 +0300 Subject: [PATCH 12/21] try removing caching --- .github/workflows/ci.yml | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49e61eb25..575dd6014 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,39 +67,17 @@ jobs: toolchain: ${{ env.RUST_VERSION }} components: clippy, rustfmt - - name: Init rust cache + - name: Init cache uses: Swatinem/rust-cache@v2 - - name: Cache nix-cache locally - id: cache-nix - uses: actions/cache@v2.1.0 - with: - # See https://stackoverflow.com/questions/59269850. - path: | - ~/nix/store - ~/nix/bin - # Using number to enforce fresh cache. - key: ${{ runner.os }}-15 - - name: Install fuel toolchain - env: - CACHE_HIT: ${{ steps.cache-nix.outputs.cache-hit }} uses: cachix/install-nix-action@v21 with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | extra-substituters = https://fuellabs.cachix.org extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= - - run: | - NIX_STORE=/nix/store - if [[ "$CACHE_HIT" != 'true' ]]; then - nix profile install github:fuellabs/fuel.nix#fuel - mkdir -p ~/nix/store - sudo cp --force --recursive $NIX_STORE/* ~/nix/store/ - else - sudo mkdir -p $NIX_STORE - sudo cp --force --recursive ~/nix/store/* $NIX_STORE/ - fi + - run: nix profile install github:fuellabs/fuel.nix#fuel - name: Check Sway formatting run: | From 3c3679aadca1c3bc14d0b9e2dc99b260de499d25 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 13:44:20 +0300 Subject: [PATCH 13/21] try different version of forc --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 575dd6014..0b51ffb1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: extra_nix_config: | extra-substituters = https://fuellabs.cachix.org extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= - - run: nix profile install github:fuellabs/fuel.nix#fuel + - run: nix profile install github:fuellabs/fuel.nix#forc-0-39-0 - name: Check Sway formatting run: | From 3401ea2c71cf05f8514c47dd1008626d10864ba4 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 13:52:11 +0300 Subject: [PATCH 14/21] try old release with caching enabled --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b51ffb1f..f74c2cede 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,17 +67,39 @@ jobs: toolchain: ${{ env.RUST_VERSION }} components: clippy, rustfmt - - name: Init cache + - name: Init rust cache uses: Swatinem/rust-cache@v2 + - name: Cache nix-cache locally + id: cache-nix + uses: actions/cache@v2.1.0 + with: + # See https://stackoverflow.com/questions/59269850. + path: | + ~/nix/store + ~/nix/bin + # Using number to enforce fresh cache. + key: ${{ runner.os }}-15 + - name: Install fuel toolchain + env: + CACHE_HIT: ${{ steps.cache-nix.outputs.cache-hit }} uses: cachix/install-nix-action@v21 with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | extra-substituters = https://fuellabs.cachix.org extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= - - run: nix profile install github:fuellabs/fuel.nix#forc-0-39-0 + - run: | + NIX_STORE=/nix/store + if [[ "$CACHE_HIT" != 'true' ]]; then + nix profile install github:fuellabs/fuel.nix#forc-0-39-0 + mkdir -p ~/nix/store + sudo cp --force --recursive $NIX_STORE/* ~/nix/store/ + else + sudo mkdir -p $NIX_STORE + sudo cp --force --recursive ~/nix/store/* $NIX_STORE/ + fi - name: Check Sway formatting run: | From e1a6c14f2dccf111aea72aa5c9f3550a7e6ebb76 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 14:19:46 +0300 Subject: [PATCH 15/21] try old release with cached nix/store From fba4adf885f564b96c29cbaa437ac304e15d1707 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 14:22:55 +0300 Subject: [PATCH 16/21] fix cache key --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f74c2cede..b122f036f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: ~/nix/store ~/nix/bin # Using number to enforce fresh cache. - key: ${{ runner.os }}-15 + key: forc-0-39-0 - name: Install fuel toolchain env: From 0ab463e1539398a910613f0f040466358dbf2e11 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 14:33:02 +0300 Subject: [PATCH 17/21] try old release with fixed key cached nix/store From 93344229498fd8532672cf5e189fc669b5e7882a Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 14:39:16 +0300 Subject: [PATCH 18/21] unpin the key and remove failing steps --- .github/workflows/ci.yml | 64 +--------------------------------------- 1 file changed, 1 insertion(+), 63 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b122f036f..b4f400613 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,8 +78,7 @@ jobs: path: | ~/nix/store ~/nix/bin - # Using number to enforce fresh cache. - key: forc-0-39-0 + key: ${{ runner.os }}-forc-0-39-0 - name: Install fuel toolchain env: @@ -100,64 +99,3 @@ jobs: sudo mkdir -p $NIX_STORE sudo cp --force --recursive ~/nix/store/* $NIX_STORE/ fi - - - name: Check Sway formatting - run: | - cd ${{ matrix.project }}/project - forc fmt --check - - - name: Check Rust formatting - run: | - cd ${{ matrix.project }}/project - cargo fmt --verbose --check - - - name: Build Sway - run: | - cd ${{ matrix.project }}/project - forc build --locked - - - name: Build Rust files - run: | - cd ${{ matrix.project }}/project - cargo build --locked - - - name: Check Clippy Linter - run: | - cd ${{ matrix.project }}/project - cargo clippy --all-features --all-targets -- -D warnings - - - name: Run Rust tests - run: | - cd ${{ matrix.project }}/project - cargo test --locked - - contributing-book: - runs-on: ubuntu-latest - - strategy: - matrix: - project: [".docs/contributing-book/src/code"] - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ env.RUST_VERSION }} - - - name: Init cache - uses: Swatinem/rust-cache@v2 - - - name: Install Fuel toolchain - uses: FuelLabs/action-fuel-toolchain@v0.6.0 - with: - toolchain: latest - date: 2023-04-12 - - - name: Check Sway formatting - run: forc fmt --check --path ${{ matrix.project }} - - - name: Build Sway - run: forc build --locked --path ${{ matrix.project }} From c85f7f1ebd83f5d55a86bf7ba448bd1be67b8be1 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 14:52:41 +0300 Subject: [PATCH 19/21] hit the cache From 3934a1a1e75add18e33ac1b461f15afabcd05cf2 Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 15:14:42 +0300 Subject: [PATCH 20/21] fix environment variables --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4f400613..9cbb5172b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,19 +77,20 @@ jobs: # See https://stackoverflow.com/questions/59269850. path: | ~/nix/store - ~/nix/bin key: ${{ runner.os }}-forc-0-39-0 - - name: Install fuel toolchain - env: - CACHE_HIT: ${{ steps.cache-nix.outputs.cache-hit }} + - name: Install nix uses: cachix/install-nix-action@v21 with: nix_path: nixpkgs=channel:nixos-unstable extra_nix_config: | extra-substituters = https://fuellabs.cachix.org extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8= - - run: | + + - name: Install fuel toolchain + env: + CACHE_HIT: ${{ steps.cache-nix.outputs.cache-hit }} + run: | NIX_STORE=/nix/store if [[ "$CACHE_HIT" != 'true' ]]; then nix profile install github:fuellabs/fuel.nix#forc-0-39-0 From ef31a2405f89199a7642f416ac218b5e197ebadb Mon Sep 17 00:00:00 2001 From: kayagokalp Date: Mon, 12 Jun 2023 15:28:35 +0300 Subject: [PATCH 21/21] hit the cache