Skip to content

Commit

Permalink
Improve GHA (0xPolygonHermez#2031)
Browse files Browse the repository at this point in the history
Remove prover mock and ok-to-test
  • Loading branch information
arnaubennassar authored Apr 24, 2023
1 parent b5978c5 commit e728386
Show file tree
Hide file tree
Showing 15 changed files with 4 additions and 2,057 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/ok-to-test.yml

This file was deleted.

82 changes: 1 addition & 81 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ on:
- update-external-dependencies
- 'release/**'
pull_request:
repository_dispatch:
types: [ok-to-test-command]

jobs:
trusted-test-e2e:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
test-e2e:
strategy:
fail-fast: false
matrix:
Expand All @@ -33,12 +30,6 @@ jobs:
env:
GOARCH: ${{ matrix.goarch }}

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker
run: make build-docker

Expand All @@ -49,74 +40,3 @@ jobs:
- name: Test
run: make test-e2e-group-${{ matrix.e2e-group }}
working-directory: test

from-fork-test-e2e:
if:
github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.sha != '' &&
contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.sha)
strategy:
matrix:
go-version: [ 1.18.x ]
goarch: [ "amd64" ]
e2e-group: [ 1, 2, 3, 4, 5, 6, 7 ]
runs-on: ubuntu-latest
steps:
- name: Fork based /ok-to-test checkout
uses: actions/checkout@v3
with:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker
run: make build-docker

- name: Compile SCs
run: make compile-scs
working-directory: test

- name: Test
run: make test-e2e-group-${{ matrix.e2e-group }}
working-directory: test

# Update check run
- uses: actions/github-script@v5
id: update-check-run
if: ${{ always() }}
env:
number: ${{ github.event.client_payload.pull_request.number }}
job: ${{ github.job }}
# Conveniently, job.status maps to https://developer.github.com/v3/checks/runs/#update-a-check-run
conclusion: ${{ job.status }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pull } = await github.rest.pulls.get({
...context.repo,
pull_number: process.env.number
});
const ref = pull.head.sha;
const { data: checks } = await github.rest.checks.listForRef({
...context.repo,
ref
});
const check = checks.check_runs.filter(c => c.name === process.env.job);
const { data: result } = await github.rest.checks.update({
...context.repo,
check_run_id: check[0].id,
status: 'completed',
conclusion: process.env.conclusion
});
return result;
52 changes: 0 additions & 52 deletions .github/workflows/test-from-prover.yml

This file was deleted.

82 changes: 1 addition & 81 deletions .github/workflows/test-full-non-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ on:
- update-external-dependencies
- 'release/**'
pull_request:
repository_dispatch:
types: [ok-to-test-command]

jobs:
trusted-test-full-non-e2e:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
test-full-non-e2e:
strategy:
matrix:
go-version: [ 1.18.x ]
Expand All @@ -31,54 +28,6 @@ jobs:
env:
GOARCH: ${{ matrix.goarch }}

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Compile SCs
run: make compile-scs
working-directory: test

- name: Test
env:
ZKPROVER_URI: 127.0.0.1
run: make test-full-non-e2e
working-directory: test

from-fork-test-full-non-e2e:
if:
github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.sha != '' &&
contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.sha)
strategy:
matrix:
go-version: [ 1.18.x ]
goarch: [ "amd64" ]
runs-on: ubuntu-latest
steps:
- name: Fork based /ok-to-test checkout
uses: actions/checkout@v3
with:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker
run: make build-docker

- name: Compile SCs
run: make compile-scs
working-directory: test
Expand All @@ -88,32 +37,3 @@ jobs:
ZKPROVER_URI: 127.0.0.1
run: make test-full-non-e2e
working-directory: test

# Update check run
- uses: actions/github-script@v5
id: update-check-run
if: ${{ always() }}
env:
number: ${{ github.event.client_payload.pull_request.number }}
job: ${{ github.job }}
conclusion: ${{ job.status }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pull } = await github.rest.pulls.get({
...context.repo,
pull_number: process.env.number
});
const ref = pull.head.sha;
const { data: checks } = await github.rest.checks.listForRef({
...context.repo,
ref
});
const check = checks.check_runs.filter(c => c.name === process.env.job);
const { data: result } = await github.rest.checks.update({
...context.repo,
check_run_id: check[0].id,
status: 'completed',
conclusion: process.env.conclusion
});
return result;
2 changes: 0 additions & 2 deletions docs/ci/actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ PR opened and pushing changes to PRs.

Pushes docker images to docker hub, the images pushed are:
* `hermeznetwork/zkevm-node:develop`
* `hermeznetwork/zkprover-mock:develop`

### When is executed

Expand All @@ -33,7 +32,6 @@ Changes pushed to the `develop` branch.

Pushes docker images to docker hub, the images pushed are:
* `hermeznetwork/zkevm-node:latest`
* `hermeznetwork/zkprover-mock:latest`

### When is executed

Expand Down
15 changes: 1 addition & 14 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ DOCKERCOMPOSEEXPLORERL2 := zkevm-explorer-l2
DOCKERCOMPOSEEXPLORERL2DB := zkevm-explorer-l2-db
DOCKERCOMPOSEEXPLORERRPC := zkevm-explorer-json-rpc
DOCKERCOMPOSEZKPROVER := zkevm-prover
DOCKERCOMPOSEZKPROVERMOCK := zkprover-mock
DOCKERCOMPOSEPERMISSIONLESSDB := zkevm-permissionless-db
DOCKERCOMPOSEPERMISSIONLESSNODE := zkevm-permissionless-node
DOCKERCOMPOSEPERMISSIONLESSZKPROVER := zkevm-permissionless-prover
Expand All @@ -41,7 +40,6 @@ RUNEXPLORERL2 := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERL2)
RUNEXPLORERL2DB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERL2DB)
RUNEXPLORERJSONRPC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERRPC)
RUNZKPROVER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEZKPROVER)
RUNZKPROVERMOCK := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEZKPROVERMOCK)

RUNPERMISSIONLESSDB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSDB)
RUNPERMISSIONLESSNODE := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSNODE)
Expand Down Expand Up @@ -71,7 +69,6 @@ STOPEXPLORERL2 := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL2) && $(DOCKERCO
STOPEXPLORERL2DB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL2DB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERL2DB)
STOPEXPLORERJSONRPC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERRPC) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERRPC)
STOPZKPROVER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEZKPROVER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEZKPROVER)
STOPZKPROVERMOCK := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEZKPROVERMOCK) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEZKPROVERMOCK)

STOPPERMISSIONLESSDB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSDB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSDB)
STOPPERMISSIONLESSNODE := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSNODE) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSNODE)
Expand All @@ -89,9 +86,7 @@ test-full-non-e2e: stop ## Runs non-e2e tests checking race conditions
$(RUNPOOLDB)
$(RUNEVENTDB)
$(RUNZKPROVER)
sleep 5
$(RUNZKPROVERMOCK)
sleep 2
sleep 7
$(RUNL1NETWORK)
sleep 15
docker logs $(DOCKERCOMPOSEZKPROVER)
Expand Down Expand Up @@ -259,14 +254,6 @@ run-zkprover: ## Runs zkprover
stop-zkprover: ## Stops zkprover
$(STOPZKPROVER)

.PHONY: run-zkprover-mock
run-zkprover-mock: ## Runs zkprover-mock
$(RUNZKPROVERMOCK)

.PHONY: stop-zkprover-mock
stop-zkprover-mock: ## Stops zkprover-mock
$(STOPZKPROVERMOCK)

.PHONY: run-l1-explorer
run-l1-explorer: ## Runs L1 blockscan explorer
$(RUNEXPLORERL1DB)
Expand Down
2 changes: 1 addition & 1 deletion test/operations/wait.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// DefaultInterval is a time interval
DefaultInterval = 2 * time.Millisecond
// DefaultDeadline is a time interval
DefaultDeadline = 30 * time.Second
DefaultDeadline = 2 * time.Minute
// DefaultTxMinedDeadline is a time interval
DefaultTxMinedDeadline = 5 * time.Second
)
Expand Down
11 changes: 0 additions & 11 deletions tools/zkevmprovermock/Dockerfile

This file was deleted.

12 changes: 0 additions & 12 deletions tools/zkevmprovermock/cmd/client.go

This file was deleted.

Loading

0 comments on commit e728386

Please sign in to comment.