Skip to content

Commit 3b75fbc

Browse files
committed
CI: build without lockfile if dependencies changed
- Makes this job less noisy if dependencies weren't modified. - Comment on the PR in case of failure to communicate that PR can still be merged. - Add badge to readme to make failures on main or scheduled builds visible.
1 parent 1f7215e commit 3b75fbc

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/build-without-lockfile.yml

+31
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
schedule:
1212
- cron: "0 0 * * 1"
1313
pull_request:
14+
# Only run on PRs if dependencies were modified.
15+
paths:
16+
- "Cargo.lock"
17+
- "**/Cargo.toml"
1418
workflow_dispatch:
1519

1620
concurrency:
@@ -33,3 +37,30 @@ jobs:
3337
run: |
3438
cargo generate-lockfile
3539
cargo check --all-targets
40+
41+
- name: Comment on PR
42+
uses: actions/github-script@v7
43+
# TODO uncomment
44+
# if: failure()
45+
with:
46+
github-token: ${{secrets.GITHUB_TOKEN}}
47+
script: |
48+
github.rest.issues.createComment({
49+
issue_number: context.issue.number,
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
body: `Unable to build without Cargo.lock file.
53+
54+
This means that after this change 3rd party projects may have
55+
difficulties using crates in this repo as a dependency. If this
56+
isn't easy to fix please open an issue so we can fix it later.
57+
58+
To reproduce locally run
59+
60+
\`\`\`
61+
cargo generate-lockfile
62+
cargo check --all-targets
63+
\`\`\`
64+
65+
This PR can still be merged.`
66+
})

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[![Lint](https://github.com/EspressoSystems/espresso-sequencer/actions/workflows/lint.yml/badge.svg)](https://github.com/EspressoSystems/espresso-sequencer/actions/workflows/lint.yml)
88
[![Audit](https://github.com/EspressoSystems/espresso-sequencer/actions/workflows/audit.yml/badge.svg)](https://github.com/EspressoSystems/espresso-sequencer/actions/workflows/audit.yml)
99
[![Ubuntu](https://github.com/EspressoSystems/espresso-sequencer/actions/workflows/ubuntu-install-without-nix.yml/badge.svg)](https://github.com/EspressoSystems/espresso-sequencer/actions/workflows/ubuntu-install-without-nix.yml)
10+
[![Build without lockfile](https://github.com/EspressoSystems/espresso-sequencer/actions/workflows/build-without-lockfile.yml/badge.svg)](https://github.com/EspressoSystems/espresso-sequencer/actions/workflows/build-without-lockfile.yml)
1011
[![Coverage Status](https://coveralls.io/repos/github/EspressoSystems/espresso-sequencer/badge.svg?branch=main)](https://coveralls.io/github/EspressoSystems/espresso-sequencer?branch=main)
1112

1213
The Espresso Sequencer offers rollups credible neutrality and enhanced interoperability, without compromising on scale.

0 commit comments

Comments
 (0)