-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use upstream Sourcify images (#164)
- Loading branch information
Showing
149 changed files
with
12,583 additions
and
129,208 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# Docker version tag to build and pull images | ||
TAG=test | ||
|
||
## Ports to access containers from the host | ||
SERVER_PORT=5555 | ||
UI_PORT=3001 | ||
REPOSITORY_PORT=10000 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,62 @@ | ||
name: Tests | ||
name: Integration Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
|
||
bytecode-utils-uts: | ||
name: bytecode-utils unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- run: npm ci | ||
- run: npx lerna bootstrap && npx lerna run build | ||
- run: cd packages/bytecode-utils && npm run test | ||
|
||
contract-call-decoder-uts: | ||
name: contract-call-decoder unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- run: npm ci | ||
- run: npx lerna bootstrap && npx lerna run build | ||
- run: cd packages/contract-call-decoder && npm run test | ||
|
||
lib-sourcify-uts: | ||
name: lib-sourcify unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- run: npm ci | ||
- run: npx lerna bootstrap && npx lerna run build | ||
- run: cd packages/lib-sourcify && npm run test | ||
|
||
server-ganache-its: | ||
server-ganache: | ||
name: server over Ganache integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Apply Sourcify server patch customizations | ||
run: npm run server:patch | ||
|
||
- name: Compile Sourcify server | ||
working-directory: ./sourcify | ||
run: | | ||
npm ci | ||
npm run build:lerna | ||
- run: npm ci | ||
- run: npx lerna bootstrap && npx lerna run build | ||
- run: npm run test:server | ||
|
||
server-local-node-its: | ||
server-local-node: | ||
name: server over Hedera's local node integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- run: npm ci | ||
|
||
- name: Provide environment variables | ||
run: cp environments/.env.dev.hedera environments/.env | ||
- name: Apply Sourcify server patch customizations | ||
run: npm run server:patch | ||
|
||
- name: Build hedera-sourcify server | ||
run: npx lerna bootstrap && npx lerna run build | ||
- run: npm ci | ||
|
||
- name: Start Hedera Local Node | ||
run: npm run local-node:start | ||
|
||
- name: Start hedera-sourcify server | ||
run: (npm run server:start&) | ||
- name: Start Sourcify server | ||
working-directory: ./sourcify | ||
run: | | ||
npm ci | ||
npm run build:lerna | ||
cp ../test/sourcify-chains.json ./services/server/dist/ | ||
(npm run server:start&) | ||
- name: Wait for hedera-sourcify server | ||
uses: iFaxity/wait-on-action@v1 | ||
with: | ||
resource: http://127.0.0.1:5002/chains | ||
resource: http://127.0.0.1:5555/chains | ||
|
||
- name: Start tests | ||
run: npm run test:hedera |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,4 @@ | ||
.idea | ||
.DS_Store | ||
db/ | ||
node_modules/ | ||
mockRepository* | ||
server.log | ||
ui/node_modules/ | ||
ui/dist/ | ||
ui/.cache/ | ||
source-verify.dab | ||
dist/ | ||
**/.env | ||
**/.env-backup | ||
**/*.key | ||
stats** | ||
tmp | ||
metacoin-source-verify/ | ||
**/synced | ||
**/sort.log | ||
logs | ||
**/too_big.txt | ||
chain-tests-report/ | ||
coverage | ||
!src/server/controllers/repository | ||
environments/docker-config.json | ||
/node_modules/ | ||
|
||
# Placeholder for volume mount point for the repository. | ||
/data/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
[submodule "h5ai-nginx"] | ||
path = h5ai-nginx | ||
url = https://github.com/sourcifyeth/h5ai-nginx | ||
ignore = dirty | ||
[submodule "sourcify"] | ||
path = sourcify | ||
url = https://github.com/ethereum/sourcify.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#diff ./sourcify/services/server/Dockerfile Dockerfile.server | ||
# Needs to be run from the project root context | ||
|
||
# Builder image | ||
FROM node:16.17.0-bullseye as builder | ||
|
||
RUN mkdir -p /home/app | ||
WORKDIR /home/app | ||
|
||
COPY . . | ||
|
||
# Install server's dependencies and build the server | ||
RUN npm ci --workspace=sourcify-server --include-workspace-root | ||
RUN npx lerna run build --scope sourcify-server | ||
|
||
###################### | ||
## Production image ## | ||
###################### | ||
FROM node:16.17.0-bullseye-slim as production | ||
|
||
RUN mkdir -p /home/app/services/server | ||
|
||
WORKDIR /home/app/ | ||
COPY package.json ./package.json | ||
COPY package-lock.json ./package-lock.json | ||
COPY lerna.json ./lerna.json | ||
COPY nx.json ./nx.json | ||
|
||
# Use `additional_contexts` in `compose.yaml` to access the `scripts` folder outside main context | ||
# See https://docs.docker.com/compose/compose-file/build/#additional_contexts for more details | ||
COPY --from=scripts ./hedera-reset-docker.sh ./ | ||
|
||
COPY --from=builder /home/app/packages/ ./packages/ | ||
COPY --from=builder /home/app/services/server/ ./services/server/ | ||
|
||
RUN npm ci --workspace=sourcify-server --include-workspace-root --omit=dev | ||
|
||
LABEL org.opencontainers.image.source https://github.com/ethereum/sourcify | ||
LABEL org.opencontainers.image.licenses MIT | ||
|
||
# Set default value for ARG | ||
ARG NODE_ENV=production | ||
|
||
# Set environment variable | ||
ENV NODE_ENV=${NODE_ENV} | ||
|
||
WORKDIR /home/app/services/server | ||
CMD ["npm", "start"] |
Oops, something went wrong.