diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 811ca1b1c..1f2e7ad74 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,13 +10,32 @@ on: - v5 jobs: + # Note: changing the name of the job disables Slither checks with the error: + # Warning: Code scanning cannot determine the alerts introduced by this pull + # request, because 1 configuration present on refs/heads/develop was not found: + # + # Actions workflow (main.yml) + # ❓ .github/workflows/main.yml:coverage coverage: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - name: Init + - name: Set up Nodejs + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' # Cache dependencies + - name: Install dependencies run: npm ci + - name: Build + run: npm run build + - name: Check storage layout + run: npm run test-storage-layout + - name: Run deployment + # Basic deployment to make sure everything is ok. + # Could be removed in the future if not relevant. + run: npm run deploy - name: Run coverage run: npm run coverage - name: Upload coverage reports to Codecov @@ -24,17 +43,15 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} slug: iExecBlockchainComputing/PoCo - - name: Run static analysis with slither + - name: Run static analysis with Slither uses: crytic/slither-action@v0.4.0 - id: slither with: target: "contracts/tools/testing/slither/" solc-version: '0.8.21' slither-args: --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/ - node-version: "20" 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: ${{ steps.slither.outputs.sarif }} + sarif_file: results.sarif diff --git a/CHANGELOG.md b/CHANGELOG.md index a2daa8df7..e19015f71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - [x] `IexecPoco2Delegate.sol` ### Features +- Sunset Jenkins pipeline (#178) - Re-use variable in `IexecPoco2Delegate` in `contribute(...)` function. (#168) - Remove unnecessary back and forth transfers in `IexecPoco2Delegate` happening during `claim(..)`. (#167) - Remove references to blockscout v5. (#161) diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 8b14c86d8..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,89 +0,0 @@ -// TODO[optionnal]: Use scripted pipeline -pipeline { - environment { - nodeJsImage = 'node:18' - } - agent any - stages { - stage('Init') { - agent { - docker { - reuseNode true - image nodeJsImage - } - } - steps { - script { - sh 'npm ci --production=false --no-progress' - sh 'npm run build' - sh 'npm run test-storage-layout' - // Verify basic deployment. Might be removed at some point. - sh 'npm run deploy' - } - } - } - stage('Hardhat tests') { - agent { - docker { - reuseNode true - image nodeJsImage - } - } - steps { - script { - test() - } - } - } - - /** - * Usage example: - * docker run --rm --entrypoint /bin/bash -v $(pwd):/share \ - * -e SOLC='' trailofbits/eth-security-toolbox -c \ - * 'cd /share && solc-select install $SOLC && \ - * slither --solc-solcs-select $SOLC ' - */ - stage('Slither') { - agent { - docker { - reuseNode true - // At this time, trailofbits/eth-security-toolbox packages - // an old slither version, hence we use another Docker image - // (which is less user-friendly. Example: node not included) - // See https://github.com/crytic/slither/issues/2207#issuecomment-1787222979 - // As discribed in the issue, version 0.8.3 is not compatible - image 'ghcr.io/crytic/slither:0.10.0' - args "-e SOLC='0.8.21' --entrypoint=" - } - } - steps { - script { - try { - sh 'solc-select install $SOLC && slither --solc-solcs-select $SOLC contracts/tools/testing/slither/' - } catch (err) { - sh "echo ${STAGE_NAME} stage is unstable" - } - } - } - } - } -} - -def test() { - try { - sh 'npm run coverage' - } catch (Exception e) { - echo 'Exception occurred: ' + e.toString() - runEachTestWithDedicatedLogFile() - } finally { - archiveArtifacts artifacts: 'coverage/**' - } -} - -def runEachTestWithDedicatedLogFile() { - try { - sh './test.sh' - } finally { - archiveArtifacts artifacts: 'logs/**' - } -}