ROLLUP-471/fix-deployment #146
Workflow file for this run
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
name: Unit/integration tests | |
on: | |
pull_request: | |
types: [ready_for_review] | |
jobs: | |
unit-integration-tests: | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install mkcert | |
run: | | |
wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.3/mkcert-v1.4.3-linux-amd64 | |
chmod +x ./mkcert* | |
cp ./mkcert* bin/mkcert | |
- name: setup-env | |
run: | | |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV | |
echo $(pwd)/bin >> $GITHUB_PATH | |
# dev.env file is required before running zk init | |
- name: create-empty-dev-file | |
run: | | |
touch $ZKSYNC_HOME/etc/env/dev.env | |
- name: start-services | |
run: | | |
docker-compose -f docker-compose.ci.yml down | |
docker-compose -f docker-compose.ci.yml pull | |
docker-compose -f docker-compose.ci.yml -f docker-compose.ci.unit-tests.yml up --build -d rskj postgres zk | |
ci_run sccache --start-server & | |
- name: generate SSL certificates | |
run: | | |
ci_run mkcert -CAROOT | |
ci_run mkcert --install | |
ci_run mkcert 127.0.0.1 localhost | |
ci_run mv 127.0.0.1+1-key.pem key.pem | |
ci_run mv 127.0.0.1+1.pem cert.pem | |
- name: init | |
run: | | |
ci_run ln -s /usr/src/keys/setup keys/setup | |
sed -i '/plonkSetup/d' infrastructure/zk/src/init.ts | |
ci_run zk | |
ci_run zk init | |
- name: start dev-ticker | |
run: docker-compose -f docker-compose.ci.yml up -d dev-ticker | |
- name: Toolchain info | |
run: | | |
node --version | |
ci_run rustc --version | |
ci_run cargo clippy --version | |
- name: contracts-unit-tests | |
run: ci_run zk test contracts | |
- name: witness-generator-unit-tests | |
run: ci_run zk test witness-generator | |
- name: server-rust-unit-tests | |
run: ci_run zk test server-rust | |
- name: db-unit-tests | |
run: ci_run zk test db | |
- name: rust-api-unit-tests | |
run: ci_run zk test rust-api | |
- name: start-services (rskj, postgres, zk) | |
run: | | |
docker-compose -f docker-compose.ci.yml down | |
docker-compose -f docker-compose.ci.yml pull | |
docker-compose -f docker-compose.ci.yml up --build -d rskj postgres zk | |
ci_run sccache --start-server & | |
- name: run zk init | |
run: | | |
ci_run zk | |
ci_run zk init | |
- name: start dev-ticker | |
run: docker-compose -f docker-compose.ci.yml up -d dev-ticker | |
- name: run-services | |
run: | | |
ci_run zk server core &>server.log & | |
ci_run zk server api &>api.log & | |
ci_run sleep 10 | |
ci_run zk dummy-prover run &>dummy_prover.log & | |
ci_run sleep 100 | |
- name: server-integration-tests | |
run: ci_run zk test i server | |
- name: api-integration-tests | |
run: | | |
ci_run zk test i api | |
ci_run zk test i api-docs | |
- name: rust-sdk-integration-tests | |
run: ci_run zk test i rust-sdk | |
- name: withdrawal-helpers-integration-tests | |
run: ci_run zk test i withdrawal-helpers | |
- name: Show logs | |
if: always() | |
run: | | |
ci_run cat server.log | |
ci_run cat api.log | |
ci_run cat dummy_prover.log | |
ci_run mkdir -p ./target/release/coverage/ | |
ci_run "grcov . --binary-path ./target/release/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore '/*' -o ./target/release/coverage/lcov.info" | |
docker compose -f docker-compose.ci.yml cp zk:/usr/src/zksync/target/release/coverage/lcov.info lcov.info | |
du lcov.info | |
- uses: codecov/codecov-action@v3 | |
with: | |
files: ./lcov.info | |
flags: unit-tests | |
name: codecov-umbrella # optional | |
verbose: true # optional (default = false) |