diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..832f6a2c00 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: Apache-2.0 + +name: Verify Build + +on: + push: + branches: + - main + pull_request: + branches: + - main + +env: + GOPATH: /opt/go + PATH: /opt/go/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin + GO_VER: 1.14.4 + +jobs: + unit-tests: + name: Unit Tests + runs-on: ubuntu-18.04 + timeout-minutes: 60 + steps: + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VER }} + - name: Install gobin + run: GO111MODULE=off go get -u github.com/myitcv/gobin + - name: Checkout Fabric Code + uses: actions/checkout@v3 + - name: Run tests + run: make unit-test + - name: Upload coverage to Codecov + run: bash <(curl https://codecov.io/bash) -t ${{ secrets.CODECOV_UPLOAD_TOKEN }} + env: + CODECOV_UPLOAD_TOKEN: ${{ secrets.CODECOV_UPLOAD_TOKEN }} + integration-tests: + name: Integration Tests + runs-on: ubuntu-18.04 + timeout-minutes: 60 + steps: + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: ${{ env.GO_VER }} + - name: Install gobin + run: GO111MODULE=off go get -u github.com/myitcv/gobin + - name: Checkout Fabric Code + uses: actions/checkout@v3 + - name: Run tests + run: make integration-test diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml deleted file mode 100644 index 17d2ab3fec..0000000000 --- a/ci/azure-pipelines.yml +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright the Hyperledger Fabric contributors. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 - -name: $(SourceBranchName)-$(Date:yyyyMMdd)$(Rev:.rrr) -trigger: -- main -pr: -- main - -variables: - GOPATH: $(Agent.BuildDirectory)/go - PATH: $(Agent.BuildDirectory)/go/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin - GOVER: 1.14 - -jobs: -- job: UnitTest - pool: - vmImage: ubuntu-18.04 - dependsOn: [] - timeoutInMinutes: 60 - steps: - - template: install_deps.yml - - checkout: self - # TODO: seperate unit-test and checks. - # TODO: resolve dependencies between dependencies.sh and install_deps.yml - - script: make unit-test - displayName: Run checks and unit test - - script: bash <(curl https://codecov.io/bash) -t $CODECOV_UPLOAD_TOKEN - env: - CODECOV_UPLOAD_TOKEN: $(CODECOV_UPLOAD_TOKEN) - displayName: Upload coverage to Codecov - -- job: IntegrationTest - pool: - vmImage: ubuntu-18.04 - dependsOn: [] - timeoutInMinutes: 60 - steps: - - template: install_deps.yml - - checkout: self - - script: make integration-test - displayName: Run integration test - env: - # TODO: update this variable name in the Makefile - JENKINS_URL: true \ No newline at end of file diff --git a/ci/install_deps.yml b/ci/install_deps.yml deleted file mode 100644 index 4fa68f5083..0000000000 --- a/ci/install_deps.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright the Hyperledger Fabric contributors. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 - -steps: - - script: sudo apt-get clean - displayName: Run apt clean - - script: sudo apt-get update - displayName: Run apt update - - script: sudo apt-get install -y gcc haveged libtool make - displayName: Install dependencies - - task: GoTool@0 - inputs: - version: $(GOVER) - goPath: $(GOPATH) - displayName: Install Go $(GOVER) - - script: GO111MODULE=off go get -u github.com/myitcv/gobin - displayName: Install gobin \ No newline at end of file