Skip to content

Commit f319648

Browse files
Merge branch 'develop' into ci/deapp
2 parents 7eec44a + 42e7a52 commit f319648

File tree

5 files changed

+153
-176
lines changed

5 files changed

+153
-176
lines changed

.drone.yml

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,3 @@
1-
kind: pipeline
2-
type: docker
3-
name: root checks
4-
5-
trigger:
6-
event:
7-
- pull_request
8-
9-
steps:
10-
- name: cat-drone-consider
11-
image: node:18.19
12-
commands:
13-
- cat .drone-consider
14-
15-
- name: check-sdk-abi
16-
image: node:18.19
17-
commands:
18-
- cd packages/sdk
19-
- npm run refresh-abis
20-
- |
21-
if [ -n "$(git diff --name-only)" ]; then
22-
echo "ABIs not up-to-date in packages/sdk, need to run 'npm run refresh-abis'"
23-
exit 1
24-
fi
25-
26-
- name: check-subgraph-abi
27-
image: node:18.19
28-
commands:
29-
- cd packages/subgraph
30-
- npm run refresh-abis
31-
- |
32-
if [ -n "$(git diff --name-only)" ]; then
33-
echo "ABIs not up-to-date in packages/subgraph, need to run 'npm run refresh-abis'"
34-
exit 1
35-
fi
36-
37-
- name: check-dapp-abi
38-
image: node:18.19
39-
commands:
40-
- cd packages/protected-data-delivery-dapp/deployment
41-
- npm run refresh-abis
42-
- |
43-
if [ -n "$(git diff --name-only)" ]; then
44-
echo "ABIs not up-to-date in protected-data-delivery-dapp/abis, need to run 'npm run refresh-abis'"
45-
exit 1
46-
fi
47-
48-
---
491
# deploy DataProtector smart contract to prod, dev or staging
502
kind: pipeline
513
type: docker

.github/workflows/root-checks.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Root checks
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
changed-files:
7+
name: Detect Changes
8+
runs-on: ubuntu-latest
9+
outputs:
10+
matrix: ${{ steps.changed.outputs.all_changed_and_modified_files }}
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Detect changed files
17+
id: changed
18+
uses: tj-actions/changed-files@v45
19+
with:
20+
matrix: 'true'
21+
dir_names: 'true'
22+
dir_names_max_depth: 3
23+
files: |
24+
packages/sdk/**
25+
packages/subgraph/**
26+
packages/protected-data-delivery-dapp/deployment/**
27+
28+
build-and-test:
29+
name: Build & Test Modified Packages
30+
needs: [changed-files]
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
package: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
35+
max-parallel: 4
36+
fail-fast: false
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: '18'
42+
43+
- name: Install dependencies and run tests for ${{ matrix.package }}
44+
working-directory: ${{ matrix.package }}
45+
run: |
46+
npm run refresh-abis
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: CI Sharing Smart Contract
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
paths:
8+
- 'packages/sharing-smart-contract/**'
9+
10+
concurrency:
11+
group: ${{ github.ref }}-sharing-smart-contract-tests
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build-and-test:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: '18'
28+
29+
- name: Install Dependencies
30+
working-directory: packages/sharing-smart-contract
31+
run: |
32+
node -v
33+
npm -v
34+
npm ci
35+
36+
- name: Install Foundry
37+
uses: foundry-rs/foundry-toolchain@v1
38+
with:
39+
version: stable
40+
cache: true
41+
42+
- name: Compile
43+
working-directory: packages/sharing-smart-contract
44+
run: npm run compile
45+
46+
- name: Check Format
47+
working-directory: packages/sharing-smart-contract
48+
run: npm run check-format
49+
50+
- name: Lint
51+
working-directory: packages/sharing-smart-contract
52+
run: npm run lint
53+
54+
- name: UML Diagrams
55+
working-directory: packages/sharing-smart-contract
56+
run: npm run uml
57+
58+
- name: Static Analyzer
59+
uses: crytic/[email protected]
60+
id: slither
61+
with:
62+
sarif: result.sarif
63+
fail-on: none
64+
target: 'packages/sharing-smart-contract/'
65+
66+
- name: Start Anvil
67+
run: |
68+
anvil --host 0.0.0.0 --port 8545 --hardfork berlin --fork-url https://bellecour.iex.ec --chain-id 134 --gas-limit 6700000 --gas-price 0 &
69+
70+
- name: Wait for Anvil to start
71+
run: |
72+
timeout=30
73+
interval=1
74+
echo "Waiting for Anvil to start..."
75+
for ((i=0; i<timeout; i++)); do
76+
if nc -z localhost 8545; then
77+
echo "Anvil is operational."
78+
exit 0
79+
fi
80+
echo "Attempt $((i+1)) of $timeout: Anvil is not ready, waiting ${interval}s..."
81+
sleep $interval
82+
done
83+
echo "Error: Anvil did not start within the timeout period."
84+
exit 1
85+
86+
- name: Hardhat Tests
87+
working-directory: packages/sharing-smart-contract
88+
run: npm run test -- --network ci-bellecour-fork
89+
90+
- name: Upgrade Test
91+
working-directory: packages/sharing-smart-contract
92+
run: npm run upgrade-local-fork -- --network local-bellecour-fork
93+
94+
- name: Set Directory Permissions
95+
working-directory: packages/sharing-smart-contract
96+
run: sudo chmod -R 777 .
97+
98+
- name: Forge Tests
99+
working-directory: packages/sharing-smart-contract
100+
run: forge test --no-match-test "invariant" -vvvv
101+
102+
- name: Upload SARIF file
103+
uses: github/codeql-action/upload-sarif@v3
104+
with:
105+
sarif_file: ${{ steps.slither.outputs.sarif }}

packages/sharing-smart-contract/.drone.yml

Lines changed: 0 additions & 126 deletions
This file was deleted.

packages/sharing-smart-contract/test/SupportsInterface.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ contract SupportsInterface is Test {
2020
);
2121
}
2222

23-
function testSupports721Interface() external view {
23+
function testSupports721Interface() external {
2424
assertTrue(_dataProtectorSharing.supportsInterface(type(IAccessControl).interfaceId));
2525
}
2626

27-
function testSupportsAccessControlInterface() external view {
27+
function testSupportsAccessControlInterface() external {
2828
assertTrue(_dataProtectorSharing.supportsInterface(type(IERC721).interfaceId));
2929
assertTrue(_dataProtectorSharing.supportsInterface(type(IERC721Metadata).interfaceId));
3030
}

0 commit comments

Comments
 (0)