Skip to content

Commit

Permalink
fix(prover): run prover checks for core changes (matter-labs#950)
Browse files Browse the repository at this point in the history
## What ❔

Runs prover build for both core and prover changes.

## Why ❔

Changes in core broke prover before. This ensures that such situations
won't happen again. See [this
thread](https://matter-labs-workspace.slack.com/archives/C05ANUCGCKV/p1706264590900969)
for more information.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
  • Loading branch information
EmilLuta authored Jan 29, 2024
1 parent 1c2cb13 commit 186d029
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci-common-reusable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Workflow template for CI jobs to be ran on both Prover and Core Components
on:
workflow_call:

jobs:
build:
runs-on: [matterlabs-ci-runner]
env:
RUNNER_COMPOSE_FILE: "docker-compose-runner-nightly.yml"

steps:
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
with:
submodules: "recursive"

- name: Setup environment
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
echo IN_DOCKER=1 >> .env
- name: Start services
run: |
docker-compose -f ${RUNNER_COMPOSE_FILE} pull
mkdir -p ./volumes/postgres
docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres
ci_run sccache --start-server
- name: Init
run: |
ci_run zk
ci_run zk db setup
# This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo
# `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build
- name: Lints
run: ci_run zk lint prover
3 changes: 0 additions & 3 deletions .github/workflows/ci-prover-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ jobs:
- name: Formatting
run: ci_run bash -c "cd prover && cargo fmt --check"

- name: Lints
run: ci_run zk lint prover

unit-tests:
runs-on: [matterlabs-ci-runner]
env:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ jobs:
name: CI for Docs
uses: ./.github/workflows/ci-docs-reusable.yml

# What needs to be ran for both core and prover
ci-for-common:
needs: changed_files
if: ${{ (needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.core == 'true' || needs.changed_files.outputs.all == 'true') && !contains(github.ref_name, 'release-please--branches') }}
name: CI for Common Components (prover or core)
uses: ./.github/workflows/ci-common-reusable.yml

build-contracts:
name: Build contracts
needs: changed_files
Expand Down

0 comments on commit 186d029

Please sign in to comment.