Skip to content

Commit

Permalink
build: adjust foundry build settings to prevent race condition when i…
Browse files Browse the repository at this point in the history
…nstalling solc in CI
  • Loading branch information
CJ42 committed Feb 28, 2024
1 parent 44841fc commit 4df8747
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/foundry-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ jobs:
run: npm ci

- name: NPM build
run: npm run build
run: |
npm run build
npm run build:foundry
- name: Run Foundry tests
run: npm run test:foundry
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ out = 'packages/lsp16-contracts/contracts/foundry_artifacts'

[profile.lsp_smart_contracts]
src = 'packages/lsp-smart-contracts/contracts'
test = 'packages/lsp-smart-contracts/foundry'
test = 'packages/lsp-smart-contracts/tests/foundry'
out = 'packages/lsp-smart-contracts/contracts/foundry_artifacts'
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"scripts": {
"preinstall": "npx --yes force-resolutions",
"build": "turbo build",
"build:foundry": "turbo build:foundry",
"build:js": "turbo build:js",
"clean": "turbo clean",
"format": "prettier --write .",
Expand Down
5 changes: 5 additions & 0 deletions packages/lsp-smart-contracts/gasreport.ansi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
No files changed, compilation skipped

No tests match the provided pattern:
no-match-test: `Skip`

3 changes: 2 additions & 1 deletion packages/lsp-smart-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
},
"scripts": {
"build": "hardhat compile --show-stack-traces",
"build:foundry": "forge build",
"build:js": "unbuild",
"build:docs": "hardhat dodoc && prettier -w ./docs",
"clean": "hardhat clean && rm -Rf dist/",
Expand All @@ -59,7 +60,7 @@
"lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'",
"package": "hardhat prepare-package",
"test": "hardhat test --no-compile tests/**/*.test.ts",
"test:foundry": "FOUNDRY_PROFILE=lsp_smart_contracts forge test --no-match-test Skip -vvv --gas-report > gasreport.ansi",
"test:foundry": "FOUNDRY_PROFILE=lsp_smart_contracts forge test --no-match-test Skip -vvv",
"test:coverage": "hardhat coverage"
},
"dependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/lsp16-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
],
"scripts": {
"build": "hardhat compile --show-stack-traces",
"build:foundry": "forge build",
"clean": "hardhat clean && rm -Rf dist/",
"format": "prettier --write .",
"lint": "eslint . --ext .ts,.js",
"lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'",
"test": "hardhat test --no-compile tests/*.test.ts",
"test:foundry": "forge test --no-match-test Skip -vvv",
"test:foundry": "FOUNDRY_PROFILE=lsp16 forge test --no-match-test Skip -vvv",
"test:coverage": "hardhat coverage"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/lsp2-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
],
"scripts": {
"build": "hardhat compile --show-stack-traces",
"build:foundry": "forge build",
"build:js": "unbuild",
"clean": "hardhat clean && rm -Rf dist/",
"format": "prettier --write .",
Expand Down
1 change: 1 addition & 0 deletions packages/lsp6-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
],
"scripts": {
"build": "hardhat compile --show-stack-traces",
"build:foundry": "forge build",
"build:js": "unbuild",
"clean": "hardhat clean && rm -Rf dist/",
"format": "prettier --write .",
Expand Down
3 changes: 2 additions & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@
],
"scripts": {
"build": "hardhat compile --show-stack-traces",
"build:foundry": "forge build",
"build:js": "unbuild",
"clean": "hardhat clean && rm -Rf dist/",
"format": "prettier --write .",
"lint": "eslint . --ext .ts,.js",
"lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'",
"test": "hardhat test --no-compile tests/*.test.ts",
"test:foundry": "forge test --no-match-test Skip -vvv",
"test:foundry": "FOUNDRY_PROFILE=lspN forge test --no-match-test Skip -vvv",
"test:coverage": "hardhat coverage"
},
"dependencies": {
Expand Down
4 changes: 4 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"outputs": ["**/artifacts/**", "types/**", "**/types/**"],
"cache": true
},
"build:foundry": {
"cache": true
},
"build:js": {
"outputs": ["**/dist/**"],
"cache": true
Expand All @@ -29,6 +32,7 @@
"cache": false
},
"test:foundry": {
"dependsOn": ["^build", "^build:foundry"],
"cache": true
}
}
Expand Down

0 comments on commit 4df8747

Please sign in to comment.