-
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.
…1907) Now we do the same as with the schema and extensions definition; provide a `just` command to update it manually and check on CI that things are up-to-date. This lets us remove the `build.rs` from `hugr-model`, removing the need for users to have `capnproto` installed to compile our crates. Closes #1667
- Loading branch information
Showing
17 changed files
with
4,764 additions
and
52 deletions.
There are no files selected for viewing
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 +1,3 @@ | ||
**/snapshots/*.snap -diff | ||
|
||
hugr-model/src/capnp/hugr_*.rs linguist-generated=true |
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 |
---|---|---|
|
@@ -86,8 +86,6 @@ jobs: | |
- uses: mozilla-actions/[email protected] | ||
- name: Install stable toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Build HUGR binary | ||
run: cargo build -p hugr-cli | ||
- name: Upload the binary to the artifacts | ||
|
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 |
---|---|---|
|
@@ -40,6 +40,7 @@ jobs: | |
outputs: | ||
rust: ${{ steps.filter.outputs.rust == 'true' || steps.override.outputs.out == 'true' }} | ||
python: ${{ steps.filter.outputs.python == 'true' || steps.override.outputs.out == 'true' }} | ||
model: ${{ steps.filter.outputs.model == 'true' || steps.override.outputs.out == 'true' }} | ||
llvm: ${{ steps.filter.outputs.llvm == 'true' || steps.override.outputs.out == 'true' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -73,8 +74,6 @@ jobs: | |
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt, clippy | ||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Check formatting | ||
run: cargo fmt -- --check | ||
- name: Install LLVM and Clang | ||
|
@@ -98,8 +97,6 @@ jobs: | |
- uses: mozilla-actions/[email protected] | ||
- name: Install stable toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Install LLVM and Clang | ||
uses: KyleMayes/install-llvm-action@v2 | ||
with: | ||
|
@@ -125,8 +122,6 @@ jobs: | |
- name: Configure default rust toolchain | ||
run: rustup override set ${{steps.toolchain.outputs.name}} | ||
|
||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Install LLVM and Clang | ||
uses: KyleMayes/install-llvm-action@v2 | ||
with: | ||
|
@@ -153,8 +148,6 @@ jobs: | |
- name: Configure default rust toolchain | ||
run: rustup override set ${{steps.toolchain.outputs.name}} | ||
|
||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Install LLVM and Clang | ||
uses: KyleMayes/install-llvm-action@v2 | ||
with: | ||
|
@@ -198,8 +191,6 @@ jobs: | |
toolchain: ${{ matrix.rust }} | ||
- name: Configure default rust toolchain | ||
run: rustup override set ${{steps.toolchain.outputs.name}} | ||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Install LLVM and Clang | ||
uses: KyleMayes/install-llvm-action@v2 | ||
with: | ||
|
@@ -239,6 +230,38 @@ jobs: | |
exit 1 | ||
fi | ||
# Ensure that the generated capnp implementation in `hugr-model` is up to date | ||
model-capnp: | ||
needs: [changes] | ||
if: ${{ needs.changes.outputs.model == 'true' && github.event_name != 'merge_group' }} | ||
name: Keep hugr-model capnp schema updated | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: mozilla-actions/[email protected] | ||
- name: Install stable toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Get cargo binstall | ||
uses: cargo-bins/cargo-binstall@main | ||
- name: Install capnproto-rust plugin | ||
run: cargo binstall capnpc | ||
- name: Regenerate the capnp code | ||
run: | | ||
capnp compile \ | ||
-orust:hugr-model/src \ | ||
--src-prefix=hugr-model \ | ||
hugr-model/capnp/hugr-v0.capnp | ||
- name: Check if the generated capnproto code is up to date | ||
run: | | ||
git diff --exit-code --name-only hugr-model/capnp/ | ||
if [ $? -ne 0 ]; then | ||
echo "The capnp generated code is not up to date" | ||
echo "Please run 'just update-model-capnp' and commit the changes" | ||
exit 1 | ||
fi | ||
tests-nightly-coverage: | ||
needs: changes | ||
# Run only if there are changes in the relevant files | ||
|
@@ -253,8 +276,6 @@ jobs: | |
# Nightly is required to count doctests coverage | ||
toolchain: "nightly" | ||
components: llvm-tools-preview | ||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Install LLVM and Clang | ||
uses: KyleMayes/install-llvm-action@v2 | ||
with: | ||
|
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.