- 
                Notifications
    
You must be signed in to change notification settings  - Fork 10
 
fix: dataProtector core fix ci #468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            22 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      37261db
              
                feat: add core smart contract CI and deploy workflows with environmen…
              
              
                Le-Caignec 174e278
              
                ci: set fetch-depth to 0 for checkout actions in CI workflows
              
              
                Le-Caignec 7570060
              
                fix: add missing cache-dependency-path for npm in CI workflow
              
              
                Le-Caignec 5b3ec47
              
                fix: add push trigger to smart contract deploy workflow
              
              
                Le-Caignec 33d0ca5
              
                fix: remove push trigger from smart contract deploy workflow
              
              
                Le-Caignec 3ad582a
              
                fix: add missing cache-dependency-path for npm in smart contract depl…
              
              
                Le-Caignec 595fe32
              
                feat: add support for Arbitrum mainnet and API V2 verification format
              
              
                gfournieriExec 742429b
              
                fix: rename deploy job to build-and-test in CI workflow
              
              
                gfournieriExec 3d207cb
              
                fix: format code
              
              
                gfournieriExec 1e842a9
              
                fix: add issue reference for Arbitrum mainnet CI support in changelog
              
              
                gfournieriExec c0a6283
              
                chore: update core-smart-contract-deploy.yml
              
              
                gfournieriExec 732464b
              
                fix: add environment variables and permissions for deploy job in CI w…
              
              
                gfournieriExec 06a3e6a
              
                fix: add step to save deployment artifacts in CI workflow
              
              
                gfournieriExec 22e7dab
              
                fix: add IS_VERIFICATION_API_V2 variable to .env.template
              
              
                gfournieriExec 0ea21a2
              
                fix: remove unused Arbitrum network configurations from Hardhat config
              
              
                gfournieriExec 1766232
              
                fix: add environment validation for mainnet deployments in CI workflow
              
              
                gfournieriExec 9bc5f19
              
                fix: streamline deployment folder naming and improve deployment ID ha…
              
              
                gfournieriExec f115fa5
              
                fix: ensure newline at end of .env.template for consistency
              
              
                gfournieriExec f5da62a
              
                fix: make node-version input optional in CI workflow
              
              
                gfournieriExec 4ffd237
              
                fix: improve mainnet deployment validation in CI workflow
              
              
                gfournieriExec 142dbfb
              
                fix: Apply suggestions from code review
              
              
                gfournieriExec 34580db
              
                fix: Update .github/workflows/core-smart-contract-ci.yml
              
              
                gfournieriExec File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| name: Core Smart Contract - Default | ||
| 
     | 
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - '*' | ||
| paths: | ||
| - 'packages/smart-contract/**' | ||
| workflow_call: | ||
| inputs: | ||
| node-version: | ||
| description: Node.js version to use | ||
| required: false | ||
| type: number | ||
| default: 20 | ||
| 
     | 
||
| concurrency: | ||
| group: ${{ github.ref }}-core-smart-contract-ci | ||
| cancel-in-progress: true | ||
| 
     | 
||
| jobs: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| 
     | 
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ inputs.node-version }} | ||
| cache: 'npm' | ||
| cache-dependency-path: 'packages/smart-contract' | ||
| 
     | 
||
| - name: Install dependencies | ||
| working-directory: packages/smart-contract | ||
| run: npm ci | ||
| 
     | 
||
| - name: Check Format | ||
| working-directory: packages/smart-contract | ||
| run: npm run check-format | ||
| 
     | 
||
| - name: Check Lint | ||
| working-directory: packages/smart-contract | ||
| run: npm run lint | ||
| 
     | 
||
| - name: Compile smart contracts | ||
| working-directory: packages/smart-contract | ||
| run: npm run compile | ||
| 
     | 
||
| - name: Run Coverage | ||
| working-directory: packages/smart-contract | ||
| run: npm run coverage | ||
| 
     | 
||
| - name: Upload coverage reports to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
                
      
                  gfournieriExec marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| slug: iExecBlockchainComputing/dataprotector-sdk | ||
| 
     | 
||
| - name: Run static analysis with slither | ||
| uses: crytic/slither-action@v0.4.1 | ||
| with: | ||
| target: "packages/smart-contract/" | ||
| slither-args: --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/ | ||
| fail-on: none # TODO set this to high or other | ||
| sarif: results.sarif | ||
| 
     | 
||
| - name: Upload SARIF file | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| name: Smart Contract Deploy | ||
| 
     | 
||
| on: | ||
| workflow_dispatch: # Manual trigger | ||
| inputs: | ||
| network: | ||
                
      
                  gfournieriExec marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| description: 'Network' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - hardhat | ||
| - avalancheFujiTestnet | ||
| - arbitrumSepolia | ||
| - arbitrum | ||
| - bellecour | ||
                
      
                  gfournieriExec marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| default: 'hardhat' | ||
| environment: | ||
| description: 'Environment' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - dev | ||
| - prod | ||
| default: 'dev' | ||
| 
     | 
||
| 
     | 
||
| jobs: | ||
| build-and-test: | ||
| uses: ./.github/workflows/core-smart-contract-ci.yml | ||
| with: | ||
| node-version: 20 | ||
| 
     | 
||
| deploy: | ||
                
      
                  gfournieriExec marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| needs: build-and-test | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| CI: true | ||
| permissions: | ||
| contents: write # Required to commit deployment files. | ||
| environment: ${{ inputs.network }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| 
     | 
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: 'npm' | ||
| cache-dependency-path: 'packages/smart-contract' | ||
| 
     | 
||
| - name: Install dependencies | ||
| working-directory: packages/smart-contract | ||
| run: npm ci | ||
| 
     | 
||
| - name: Validate deployment environment and prepare variables | ||
| if: inputs.network != 'hardhat' | ||
| run: | | ||
| NETWORK="${{ inputs.network }}" | ||
                
      
                  gfournieriExec marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| ENVIRONMENT="${{ inputs.environment }}" | ||
| 
     | 
||
| case "$NETWORK" in | ||
| arbitrum|bellecour) | ||
| if [ "$ENVIRONMENT" = "dev" ]; then | ||
| echo "Error: Cannot deploy to mainnet ($NETWORK) with dev environment" | ||
| exit 1 | ||
| fi | ||
| echo "IS_MAINNET=true" >> $GITHUB_ENV | ||
| ;; | ||
| *) | ||
| echo "IS_MAINNET=false" >> $GITHUB_ENV | ||
| ;; | ||
| esac | ||
| 
     | 
||
                
      
                  zguesmi marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| - name: Deploy contract | ||
| working-directory: packages/smart-contract | ||
| env: | ||
| # For Deployment | ||
| RPC_URL: ${{ secrets.RPC_URL }} | ||
| DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }} | ||
| DATASET_REGISTRY_ADDRESS: ${{ vars.DATASET_REGISTRY_ADDRESS }} | ||
| # For Verification | ||
| EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }} | ||
| IS_VERIFICATION_API_V2: ${{ vars.IS_VERIFICATION_API_V2 }} | ||
                
      
                  zguesmi marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| run: | | ||
| if [ "${{ inputs.network }}" = "hardhat" ]; then | ||
| npm run deploy -- --network ${{ inputs.network }} | ||
| else | ||
| # For testnets, use network-environment; for mainnets, use network only | ||
| if [ "$IS_MAINNET" = false ]; then | ||
| DEPLOYMENT_ID="${{ inputs.network }}-${{ inputs.environment }}" | ||
| else | ||
| DEPLOYMENT_ID="${{ inputs.network }}" | ||
| fi | ||
| npm run deploy -- --network ${{ inputs.network }} --deployment-id "$DEPLOYMENT_ID" --verify | ||
| fi | ||
| 
     | 
||
| - name: Save deployment artifacts | ||
| if: inputs.network != 'hardhat' | ||
| uses: stefanzweifel/git-auto-commit-action@v5 | ||
| with: | ||
| commit_message: 'chore: save deployment artifacts for ${{ inputs.network }} ${{ inputs.environment }} (${{ github.run_id }})' | ||
| file_pattern: 'packages/smart-contract/ignition/deployments/*' | ||
| commit_user_name: 'GitHub Actions Bot' | ||
| commit_user_email: 'github-actions[bot]@users.noreply.github.com' | ||
| commit_author: 'GitHub Actions Bot <github-actions[bot]@users.noreply.github.com>' | ||
This file was deleted.
      
      Oops, something went wrong.
      
    
  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 20 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.