Skip to content

Commit

Permalink
removed alpine, dockerized coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mllwchrry committed Oct 31, 2024
1 parent 88552f1 commit 8f45af8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Build Docker Image and Run Tests
run: docker build --build-arg NODE_VERSION=${{ matrix.node }}.0.0 -t hardhat-zkit-test-runner-node${{ matrix.node }} --progress=plain --no-cache .
run: docker build --build-arg NODE_VERSION=${{ matrix.node }} -t hardhat-zkit-test-runner-node${{ matrix.node }} --progress=plain --no-cache .

- name: Cleanup Docker resources
run: |
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
ARG NODE_VERSION=20.0.0
ARG NODE_VERSION=20

FROM node:${NODE_VERSION}-alpine
FROM node:${NODE_VERSION}

WORKDIR /hardhat-zkit

COPY . .

RUN npm install

RUN npm run test-local
ARG RUN_TESTS=true

RUN if [ "$RUN_TESTS" = "true" ]; then npm run test-local; fi
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
"test": "npm run test-docker",
"test-docker": "docker build -t hardhat-zkit --progress=plain --no-cache . && docker rmi hardhat-zkit --force",
"test-local": "mocha --recursive 'test/**/*.ts' --exit",
"coverage": "nyc mocha --recursive 'test/**/*.ts' --exit",
"coverage": "npm run coverage-docker",
"coverage-docker": "bash scripts/docker-coverage.sh",
"coverage-local": "nyc mocha --recursive 'test/**/*.ts' --exit",
"clean-tests": "npm run clean --workspaces",
"lint-fix": "prettier --write \"./**/*.ts\" && eslint \"{src,test}/**/*.{js,ts}\" --cache --fix",
"publish-to-npm": "npm run build && npm run lint-fix && npm publish ./ --access public"
Expand Down
5 changes: 5 additions & 0 deletions scripts/docker-coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

docker build --build-arg RUN_TESTS=false -t hardhat-zkit --progress=plain --no-cache .
docker run --rm -v $(pwd)/coverage:/hardhat-zkit/coverage hardhat-zkit npm run coverage-local
docker rmi hardhat-zkit --force

0 comments on commit 8f45af8

Please sign in to comment.