-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'acl/const_fold2' into acl/const_fold3
- Loading branch information
Showing
291 changed files
with
18,091 additions
and
3,200 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
**/snapshots/*.snap -diff |
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 |
---|---|---|
|
@@ -18,3 +18,7 @@ python: | |
- "uv.lock" | ||
- "specification/schema/**" | ||
- ".github/workflows/ci-py.yml" | ||
|
||
|
||
llvm: | ||
- "hugr-llvm/**" |
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- '*' | ||
merge_group: | ||
types: [checks_requested] | ||
workflow_dispatch: {} | ||
|
@@ -55,7 +55,7 @@ jobs: | |
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v3 | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: ${{ env.UV_VERSION }} | ||
enable-cache: true | ||
|
@@ -110,7 +110,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
|
||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v3 | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: ${{ env.UV_VERSION }} | ||
enable-cache: true | ||
|
@@ -141,7 +141,7 @@ jobs: | |
- name: Upload python coverage to codecov.io | ||
if: github.event_name != 'merge_group' && matrix.python-version.coverage | ||
uses: codecov/codecov-action@v4 | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
files: coverage.xml | ||
name: python | ||
|
@@ -160,7 +160,7 @@ jobs: | |
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v3 | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: ${{ env.UV_VERSION }} | ||
enable-cache: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- '*' | ||
merge_group: | ||
types: [checks_requested] | ||
workflow_dispatch: {} | ||
|
@@ -23,7 +23,7 @@ env: | |
|
||
jobs: | ||
# Check if changes were made to the relevant files. | ||
# Always returns true if running on the default branch, to ensure all changes are throughly checked. | ||
# Always returns true if running on the default branch, to ensure all changes are thoroughly checked. | ||
changes: | ||
name: Check for changes | ||
runs-on: ubuntu-latest | ||
|
@@ -35,6 +35,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' }} | ||
llvm: ${{ steps.filter.outputs.llvm == 'true' || steps.override.outputs.out == 'true' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Override label | ||
|
@@ -91,9 +92,9 @@ jobs: | |
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Build benchmarks with no features | ||
run: cargo bench --verbose --no-run --workspace --no-default-features | ||
run: cargo bench --verbose --no-run --no-default-features | ||
- name: Build benchmarks with all features | ||
run: cargo bench --verbose --no-run --workspace --all-features | ||
run: cargo bench --verbose --no-run --all-features | ||
|
||
# Run tests on Rust stable | ||
tests-stable-no-features: | ||
|
@@ -110,12 +111,13 @@ jobs: | |
toolchain: "stable" | ||
- name: Configure default rust toolchain | ||
run: rustup override set ${{steps.toolchain.outputs.name}} | ||
|
||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Build with no features | ||
run: cargo test --verbose --workspace --no-default-features --no-run | ||
run: cargo test --verbose --no-default-features --no-run | ||
- name: Tests with no features | ||
run: cargo test --verbose --workspace --no-default-features | ||
run: cargo test --verbose --no-default-features | ||
|
||
# Run tests on Rust stable | ||
tests-stable-all-features: | ||
|
@@ -132,12 +134,13 @@ jobs: | |
toolchain: "stable" | ||
- name: Configure default rust toolchain | ||
run: rustup override set ${{steps.toolchain.outputs.name}} | ||
|
||
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Build with all features | ||
run: cargo test --verbose --workspace --all-features --no-run | ||
run: cargo test --verbose --all-features --no-run | ||
- name: Tests with all features | ||
run: cargo test --verbose --workspace --all-features | ||
run: cargo test --verbose --all-features | ||
- name: Build HUGR binary | ||
run: cargo build -p hugr-cli | ||
- name: Upload the binary to the artifacts | ||
|
@@ -170,13 +173,13 @@ jobs: | |
- name: Install CapnProto | ||
run: sudo apt-get install -y capnproto | ||
- name: Build with no features | ||
run: cargo test --verbose --workspace --no-default-features --no-run | ||
run: cargo test --verbose --no-default-features --no-run | ||
- name: Tests with no features | ||
run: cargo test --verbose --workspace --no-default-features | ||
run: cargo test --verbose --no-default-features | ||
- name: Build with all features | ||
run: cargo test --verbose --workspace --all-features --no-run | ||
run: cargo test --verbose --all-features --no-run | ||
- name: Tests with all features | ||
run: cargo test --verbose --workspace --all-features | ||
run: cargo test --verbose --all-features | ||
|
||
# Ensure that serialized extensions match rust implementation | ||
std-extensions: | ||
|
@@ -220,31 +223,61 @@ jobs: | |
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: | ||
version: "14.0" | ||
env: true | ||
- name: Install cargo-llvm-cov | ||
uses: taiki-e/install-action@cargo-llvm-cov | ||
- name: Run tests with coverage instrumentation | ||
run: | | ||
cargo llvm-cov clean --workspace | ||
cargo llvm-cov --no-report --workspace --no-default-features --doctests | ||
cargo llvm-cov --no-report --workspace --all-features --doctests | ||
cargo llvm-cov --no-report --no-default-features --doctests | ||
cargo llvm-cov --no-report --all-features --doctests | ||
cargo llvm-cov --no-report -p hugr-llvm --features llvm14-0 --doctests | ||
- name: Generate coverage report | ||
run: cargo llvm-cov --all-features report --codecov --output-path coverage.json | ||
- name: Upload coverage to codecov.io | ||
uses: codecov/codecov-action@v4 | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
files: coverage.json | ||
name: rust | ||
flags: rust | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
rs-semver-checks: | ||
needs: [changes, check] | ||
if: ${{ needs.changes.outputs.rust == 'true' && github.event_name == 'pull_request' }} | ||
uses: CQCL/hugrverse-actions/.github/workflows/rs-semver-checks.yml@main | ||
with: | ||
apt-dependencies: capnproto | ||
secrets: | ||
GITHUB_PAT: ${{ secrets.HUGRBOT_PAT }} | ||
tests-stable-llvm: | ||
needs: changes | ||
if: ${{ ( needs.changes.outputs.llvm == 'true' && github.event_name == 'push' ) || needs.changes.outputs.override == 'true' }} | ||
runs-on: ubuntu-latest | ||
name: tests hugr-llvm | ||
strategy: | ||
matrix: | ||
llvm-version: | ||
# different strings for install action and feature name | ||
# adapted from https://github.com/TheDan64/inkwell/blob/master/.github/workflows/test.yml | ||
- ["14.0", "14-0"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: mozilla-actions/[email protected] | ||
- id: toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: "stable" | ||
- 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: | ||
version: ${{ matrix.llvm-version[0] }} | ||
env: true | ||
- name: Build | ||
run: cargo test -p hugr-llvm --verbose --features llvm${{ matrix.llvm-version[1] }} --no-run | ||
- name: Tests with no features | ||
run: cargo test -p hugr-llvm --verbose --features llvm${{ matrix.llvm-version[1] }} | ||
|
||
# This is a meta job to mark successful completion of the required checks, | ||
# even if they are skipped due to no changes in the relevant files. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ jobs: | |
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set up uv | ||
uses: astral-sh/setup-uv@v3 | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
version: "0.4.18" | ||
enable-cache: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Rust Semver Checks | ||
on: | ||
pull_request_target: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
# Check if changes were made to the relevant files. | ||
# Always returns true if running on the default branch, to ensure all changes are throughly checked. | ||
changes: | ||
name: Check for changes | ||
runs-on: ubuntu-latest | ||
# Required permissions | ||
permissions: | ||
pull-requests: read | ||
# Set job outputs to values from filter step | ||
# These outputs are always true when running after a merge to main, or if the PR has a `run-ci-checks` label. | ||
outputs: | ||
rust: ${{ steps.filter.outputs.rust == 'true' || steps.override.outputs.out == 'true' }} | ||
python: ${{ steps.filter.outputs.python == 'true' || steps.override.outputs.out == 'true' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Override label | ||
id: override | ||
run: | | ||
echo "Label contains run-ci-checks: $OVERRIDE_LABEL" | ||
if [ "$OVERRIDE_LABEL" == "true" ]; then | ||
echo "Overriding due to label 'run-ci-checks'" | ||
echo "out=true" >> $GITHUB_OUTPUT | ||
elif [ "$DEFAULT_BRANCH" == "true" ]; then | ||
echo "Overriding due to running on the default branch" | ||
echo "out=true" >> $GITHUB_OUTPUT | ||
fi | ||
env: | ||
OVERRIDE_LABEL: ${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'run-ci-checks') }} | ||
DEFAULT_BRANCH: ${{ github.ref_name == github.event.repository.default_branch }} | ||
- uses: dorny/paths-filter@v3 | ||
id: filter | ||
with: | ||
filters: .github/change-filters.yml | ||
|
||
rs-semver-checks: | ||
needs: [changes] | ||
if: ${{ needs.changes.outputs.rust == 'true' }} | ||
uses: CQCL/hugrverse-actions/.github/workflows/rs-semver-checks.yml@main | ||
with: | ||
apt-dependencies: capnproto | ||
secrets: | ||
GITHUB_PAT: ${{ secrets.HUGRBOT_PAT }} |
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
Oops, something went wrong.