diff --git a/.circleci/config.yml b/.circleci/config.yml index c817e00e6..ea336863b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,29 +10,46 @@ jobs: version: 20.10.7 docker_layer_caching: true - run: - name: "Building docker image" + name: "Installing node and go" command: | - docker build --file Dockerfile.test -t razor-test . + + sudo add-apt-repository -y ppa:ethereum/ethereum + sudo apt-get update + sudo apt-get install npm ethereum + - run: + name: "Installing dependencies" + command: | + npm i + go get -d github.com/ethereum/go-ethereum@v1.10.8 \ + && go install github.com/ethereum/go-ethereum/cmd/abigen@v1.10.8 \ + && go install github.com/mattn/goveralls@v0.0.11 \ + && go install github.com/ory/go-acc@v0.2.7 \ + && go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.46.2 + + - run: + name: "Make Setup" + command: | + make setup - run: name: "go-fmt" command: | - docker run --rm -v $(pwd):/test --name go razor-test gofmt + gofmt - run: name: "go-lint" command: | - docker run --rm -v $(pwd):/test --name go razor-test golangci-lint run -v --timeout 5m + golangci-lint run -v --timeout 5m - run: name: "Executing test cases" command: | - docker run --rm -v $(pwd):/test --name go razor-test go-acc ./... --ignore razor/accounts/mocks --ignore razor/cmd/mocks --ignore razor/utils/mocks --ignore pkg --ignore razor/path/mocks --output /test/coverage.txt + go-acc ./... --ignore razor/accounts/mocks --ignore razor/cmd/mocks --ignore razor/utils/mocks --ignore pkg --ignore razor/path/mocks --output coverage.txt - run: name: "Executing benchmarks" command: | - docker run --rm -v $(pwd):/test --name go razor-test go test ./... -bench=. -run=^# + go test ./... -bench=. -run=^# - run: name: "Publish Coverage to Coveralls.io" command: | - docker run --rm -v $(pwd):/test --name go -e COVERALLS_TOKEN=$COVERALLS_TOKEN razor-test goveralls -coverprofile=/test/coverage.txt -service semaphore -repotoken $COVERALLS_TOKEN + goveralls -coverprofile=coverage.txt -service semaphore -repotoken $COVERALLS_TOKEN - persist_to_workspace: root: . paths: diff --git a/Dockerfile.test b/Dockerfile.test deleted file mode 100644 index 22ea2854d..000000000 --- a/Dockerfile.test +++ /dev/null @@ -1,17 +0,0 @@ -FROM node:16.2.0-alpine AS builder -WORKDIR /app -COPY package.json package.json -RUN npm install - -FROM golang:1.17 as ethereum -RUN apt update && apt install jq -y -WORKDIR /app -RUN go get -d github.com/ethereum/go-ethereum@v1.10.8 \ -&& go install github.com/ethereum/go-ethereum/cmd/abigen@v1.10.8 \ -&& go install github.com/mattn/goveralls@v0.0.11 \ -&& go install github.com/ory/go-acc@v0.2.7 \ -&& go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2 - -COPY --from=builder /app/node_modules node_modules -COPY . . -RUN make setup