diff --git a/.github/workflows/coordinator.yml b/.github/workflows/coordinator.yml index a8ad82e8d..fcb22d46b 100644 --- a/.github/workflows/coordinator.yml +++ b/.github/workflows/coordinator.yml @@ -110,6 +110,7 @@ jobs: - name: Test coordinator packages working-directory: 'coordinator' run: | + # go test -exec "env LD_LIBRARY_PATH=${PWD}/verifier/lib" -v -race -gcflags="-l" -ldflags="-s=false" -coverpkg="scroll-tech/coordinator" -coverprofile=coverage.txt -covermode=atomic ./... go test -v -race -gcflags="-l" -ldflags="-s=false" -coverprofile=coverage.txt -covermode=atomic -tags mock_verifier ./... - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 717f5a534..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,100 +0,0 @@ -imagePrefix = 'scrolltech' -credentialDocker = 'dockerhub' - -pipeline { - agent any - options { - timeout (20) - } - tools { - nodejs "nodejs" - go 'go-1.19' - } - environment { - GOBIN = '/home/ubuntu/go/bin/' - GO111MODULE = 'on' - PATH="/home/ubuntu/.cargo/bin:$PATH" - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./coordinator/verifier/lib" - CHAIN_ID='534353' - // LOG_DOCKER = 'true' - } - stages { - stage('Build') { - parallel { - stage('Build Prerequisite') { - steps { - sh 'make dev_docker' - sh 'make -C bridge mock_abi' - sh 'make -C common/bytecode all' - } - } - stage('Check Bridge Compilation') { - steps { - sh 'make -C bridge bridge_bins' - } - } - stage('Check Coordinator Compilation') { - steps { - sh 'export PATH=/home/ubuntu/go/bin:$PATH' - sh 'make -C coordinator coordinator' - } - } - stage('Check Database Compilation') { - steps { - sh 'make -C database db_cli' - } - } - stage('Check Database Docker Build') { - steps { - sh 'make -C database docker' - } - } - } - } - stage('Parallel Test') { - parallel{ - stage('Race test common package') { - steps { - sh 'go test -v -race -coverprofile=coverage.common.txt -covermode=atomic scroll-tech/common/...' - } - } - stage('Race test bridge package') { - steps { - sh "cd ./bridge && ../build/run_tests.sh bridge" - } - } - stage('Race test coordinator package') { - steps { - sh 'cd ./coordinator && go test -exec "env LD_LIBRARY_PATH=${PWD}/verifier/lib" -v -race -gcflags="-l" -ldflags="-s=false" -coverpkg="scroll-tech/coordinator" -coverprofile=../coverage.coordinator.txt -covermode=atomic ./...' - } - } - stage('Race test database package') { - steps { - sh 'go test -v -race -coverprofile=coverage.db.txt -covermode=atomic scroll-tech/database/...' - } - } - stage('Integration test') { - steps { - sh 'go test -v -tags="mock_prover mock_verifier" -p 1 scroll-tech/integration-test/...' - } - } - } - } - stage('Compare Coverage') { - steps { - sh './build/post-test-report-coverage.sh' - script { - currentBuild.result = 'SUCCESS' - } - step([$class: 'CompareCoverageAction', publishResultAs: 'Comment', scmVars: [GIT_URL: env.GIT_URL]]) - } - } - } - post { - always { - publishCoverage adapters: [coberturaReportAdapter(path: 'cobertura.xml', thresholds: [[thresholdTarget: 'Aggregated Report', unhealthyThreshold: 40.0]])], checksName: '', sourceFileResolver: sourceFiles('NEVER_STORE') - cleanWs() - slackSend(message: "${JOB_BASE_NAME} ${GIT_COMMIT} #${BUILD_NUMBER} deploy ${currentBuild.result}") - } - } -} diff --git a/build/post-test-report-coverage.sh b/build/post-test-report-coverage.sh deleted file mode 100755 index 017932463..000000000 --- a/build/post-test-report-coverage.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -uex -${GOBIN}/gocover-cobertura < coverage.bridge.txt > coverage.bridge.xml -${GOBIN}/gocover-cobertura < coverage.db.txt > coverage.db.xml -${GOBIN}/gocover-cobertura < coverage.common.txt > coverage.common.xml -${GOBIN}/gocover-cobertura < coverage.coordinator.txt > coverage.coordinator.xml -#${GOROOT}/bin/bin/gocover-cobertura < coverage.integration.txt > coverage.integration.xml - -npx cobertura-merge -o cobertura.xml \ - package1=coverage.bridge.xml \ - package2=coverage.db.xml \ - package3=coverage.common.xml \ - package4=coverage.coordinator.xml - # package5=coverage.integration.xml diff --git a/build/push-docker-tag.Jenkinsfile b/build/push-docker-tag.Jenkinsfile deleted file mode 100644 index 51ad7b6b9..000000000 --- a/build/push-docker-tag.Jenkinsfile +++ /dev/null @@ -1,85 +0,0 @@ -imagePrefix = 'scrolltech' -credentialDocker = 'dockerhub' -TAGNAME = '' -pipeline { - agent any - options { - timeout (20) - } - tools { - go 'go-1.19' - nodejs "nodejs" - } - environment { - GO111MODULE = 'on' - PATH="/home/ubuntu/.cargo/bin:$PATH" - // LOG_DOCKER = 'true' - } - stages { - stage('Tag') { - steps { - script { - TAGNAME = sh(returnStdout: true, script: 'git tag -l --points-at HEAD') - sh "echo ${TAGNAME}" - // ... - } - } - } - stage('Build') { - environment { - // Extract the username and password of our credentials into "DOCKER_CREDENTIALS_USR" and "DOCKER_CREDENTIALS_PSW". - // (NOTE 1: DOCKER_CREDENTIALS will be set to "your_username:your_password".) - // The new variables will always be YOUR_VARIABLE_NAME + _USR and _PSW. - // (NOTE 2: You can't print credentials in the pipeline for security reasons.) - DOCKER_CREDENTIALS = credentials('dockerhub') - } - steps { - withCredentials([usernamePassword(credentialsId: "${credentialDocker}", passwordVariable: 'dockerPassword', usernameVariable: 'dockerUser')]) { - // Use a scripted pipeline. - script { - stage('Push image') { - if (TAGNAME == ""){ - return; - } - sh "docker login --username=$dockerUser --password=$dockerPassword" - catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') { - script { - try { - sh "docker manifest inspect scrolltech/bridge:$TAGNAME > /dev/null" - } catch (e) { - // only build if the tag non existed - //sh "docker login --username=${dockerUser} --password=${dockerPassword}" - sh "make -C bridge docker" - sh "docker tag scrolltech/bridge:latest scrolltech/bridge:${TAGNAME}" - sh "docker push scrolltech/bridge:${TAGNAME}" - throw e - } - } - } - catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') { - script { - try { - sh "docker manifest inspect scrolltech/coordinator:$TAGNAME > /dev/null" - } catch (e) { - // only build if the tag non existed - //sh "docker login --username=${dockerUser} --password=${dockerPassword}" - sh "make -C coordinator docker" - sh "docker tag scrolltech/coordinator:latest scrolltech/coordinator:${TAGNAME}" - sh "docker push scrolltech/coordinator:${TAGNAME}" - throw e - } - } - } - } - } - } - } - } - } - post { - always { - cleanWs() - slackSend(message: "${JOB_BASE_NAME} ${GIT_COMMIT} #${TAGNAME} Tag build ${currentBuild.result}") - } - } -}