Skip to content

Commit

Permalink
nix: update nixpkgs to the latest & using node20 by default (#2001)
Browse files Browse the repository at this point in the history
* nix: update nixpkgs to the latest

* tasks/check-changeset.sh renamed

* ci.feature: cancel concurrent workflows

* run lcov ignoring inconsistent errors
  • Loading branch information
hellwolf authored Aug 8, 2024
1 parent b9cd188 commit 029035e
Show file tree
Hide file tree
Showing 22 changed files with 196 additions and 172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call.deploy-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash {0}
shell: nix develop .#ci-default -c bash {0}

steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/call.test-local-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
# FIXME: subgraph test fails with node20
shell: nix develop .#ci-node18 -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -59,7 +60,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-node18 -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/call.test-sdk-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
# FIXME: subgraph test fails with node20
shell: nix develop .#ci-node18 -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call.test-solidity-semantic-money.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

defaults:
run:
shell: nix develop . -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/call.upload-coverage-reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
name: ethereum-contracts-coverage
path: packages/ethereum-contracts/coverage
- name: Upload ethereum-contracts-coverage to codecov
uses: codecov/codecov-action@v4.2.0
uses: codecov/codecov-action@v4.3.0
with:
token: ${{ secrets.codecov_token }}
files: packages/ethereum-contracts/coverage/lcov.info
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cd.feature.create-pr-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

if: ${{ !github.event.pull_request.draft }}

Expand Down Expand Up @@ -41,8 +41,8 @@ jobs:
echo " .locked" ${{ github.event.pull_request.locked }}
echo " .draft" ${{ github.event.pull_request.draft }}
- name: Check changeset
run: tasks/check-changeset.sh ${{ github.sha }} dev
- name: Create build set
run: tasks/create-build-set.sh ${{ github.sha }} dev origin

- name: Install dependencies
if: env.PUBLISH_PR_ARTIFACT == 1
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Check changeset
run: tasks/check-changeset.sh ${{ github.sha }} dev
- name: Create build set
run: tasks/create-build-set.sh ${{ github.sha }} dev origin

essential-build-and-test:
name: Build and test essential packages of dev branch
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -288,7 +288,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/ci.feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
merge_group:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
check:
name: Checking what packages need to be built
Expand Down Expand Up @@ -59,8 +63,8 @@ jobs:
- name: Run pre-commit check
run: npm run pre-commit

- name: Check changeset
run: tasks/check-changeset.sh ${{ github.sha }} dev
- name: Create build set
run: tasks/create-build-set.sh ${{ github.sha }} dev origin

test-ethereum-contracts:
name: Test ethereum-contracts (Feature Branch)
Expand All @@ -71,7 +75,7 @@ jobs:
run-coverage-tests: false

coverage-ethereum-contracts:
name: Coverage test ethereum-contracts (Feature Branch)
name: Coverage Test ethereum-contracts (Feature Branch)
uses: ./.github/workflows/call.test-ethereum-contracts.yml
needs: [check]
if: needs.check.outputs.build_ethereum_contracts
Expand Down Expand Up @@ -106,7 +110,7 @@ jobs:

# sdk-core integration test + local subgraph w/ local sdk-core
test-sdk-core:
name: Test SDK-Core (Feature Branch)
name: Test sdk-core (Feature Branch)
uses: ./.github/workflows/call.test-sdk-core.yml
needs: [check]
if: needs.check.outputs.build_sdk_core
Expand All @@ -116,7 +120,7 @@ jobs:
run-coverage-tests: false

coverage-sdk-core:
name: Test SDK-Core (Feature Branch)
name: Coverage Test sdk-core (Feature Branch)
uses: ./.github/workflows/call.test-sdk-core.yml
needs: [check]
if: needs.check.outputs.build_sdk_core
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/handler.changelog-reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Check changeset
run: tasks/check-changeset.sh ${{ github.sha }} dev
- name: Create build set
run: tasks/create-build-set.sh ${{ github.sha }} dev origin

create-reminder:
name: Create Changelog reminder in PR discussion

Expand All @@ -45,4 +45,4 @@ jobs:
Reminder to update the CHANGELOG.md for any of the modified packages in this PR.
- [ ] CHANGELOG.md modified
- [ ] Double check before merge
reactions: white_check_mark
reactions: white_check_mark
2 changes: 1 addition & 1 deletion .github/workflows/handler.deploy-to-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/handler.deploy-to-testnets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/handler.list-super-token.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/handler.publish-release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/handler.run-ethereum-contracts-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

env:
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
RESOLVER_ADMIN_TYPE: ${{ github.event.inputs.admin_type }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/handler.verify-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

defaults:
run:
shell: nix develop -c bash -xe {0}
shell: nix develop .#ci-default -c bash -xe {0}

steps:
- uses: actions/checkout@v4
Expand Down
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
];

# minimem development shell
minimumDevInputs = commonDevInputs ++ ethDevInputs ++ node18DevInputs;
minimumDevInputs = commonDevInputs ++ ethDevInputs ++ node20DevInputs;

# additional tooling for whitehat hackers
whitehatInputs = with pkgs; [
Expand Down Expand Up @@ -113,9 +113,7 @@
FOUNDRY_OFFLINE = "true";
FOUNDRY_SOLC_VERSION = pkgs.lib.getExe pkgs.${solcVer};
} // o);

# ci-spec-with-ghc
ci-spec-with-ghc = ghcVer : mkShell {
mkShellForSpecCI = ghcVer : mkShell {
buildInputs = with pkgs; [
cabal-install
haskell.compiler.${ghcVer}
Expand All @@ -142,14 +140,17 @@
};

# CI shells
devShells.ci-default = mkShell {
buildInputs = ciInputs ++ minimumDevInputs;
};
devShells.ci-node18 = mkShell {
buildInputs = ciInputs ++ commonDevInputs ++ ethDevInputs ++ node18DevInputs;
};
devShells.ci-node20 = mkShell {
buildInputs = ciInputs ++ commonDevInputs ++ ethDevInputs ++ node20DevInputs;
};
devShells.ci-spec-ghc92 = ci-spec-with-ghc ghcVer92;
devShells.ci-spec-ghc94 = ci-spec-with-ghc ghcVer94;
devShells.ci-spec-ghc92 = mkShellForSpecCI ghcVer92;
devShells.ci-spec-ghc94 = mkShellForSpecCI ghcVer94;
devShells.ci-hot-fuzz = mkShell {
buildInputs = with pkgs; ciInputs ++ commonDevInputs ++ ethDevInputs ++ [
slither-analyzer
Expand Down
8 changes: 5 additions & 3 deletions packages/ethereum-contracts/tasks/coverage-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ set -ex

cd "$(dirname "$0")"/..

LCOV="lcov --ignore-errors inconsistent"

# extract coverage for Superfluid contracts from forge coverage
lcov -e ../../lcov.info \
$LCOV -e ../../lcov.info \
"packages/ethereum-contracts/contracts/*" \
-o lcov.info

# remove contracts whose coverage we don't care about (see .solcover.js)
lcov -r lcov.info \
$LCOV -r lcov.info \
"packages/ethereum-contracts/contracts/mocks/*" \
"packages/ethereum-contracts/contracts/apps/*Base*" \
"packages/ethereum-contracts/contracts/utils/*Test*" \
Expand All @@ -19,6 +21,6 @@ lcov -r lcov.info \
-o lcov.info

# merge hardhat and forge coverage files
lcov -a lcov.info \
$LCOV -a lcov.info \
-a coverage/lcov.info \
-o coverage/lcov.info
Loading

0 comments on commit 029035e

Please sign in to comment.