Skip to content

Commit

Permalink
Merge branch 'main' into feature/latex
Browse files Browse the repository at this point in the history
  • Loading branch information
kalzoo committed Jun 24, 2024
2 parents 5a44377 + 5b8b59b commit d5b2739
Show file tree
Hide file tree
Showing 339 changed files with 30,171 additions and 8,276 deletions.
11 changes: 11 additions & 0 deletions .github/test_events/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# GitHub Test Events

This folder contains mock GitHub webhook events. They can be used as input to [nektos/act](https://github.com/nektos/act) to simulate what will happen for that event. This is useful for testing CI changes locally.

For example, to simulate what will happen in GitHub actions run when a Python pre-release is published, you can run:

```sh
act release -n -e .github/test_events/prerelease_python.json
```

These payloads are adapted from GitHub's examples in [Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows).
78 changes: 78 additions & 0 deletions .github/test_events/python_prerelease.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"action": "published",
"release": {
"url": "https://api.github.com/repos/octocat/Hello-World/releases/1",
"html_url": "https://github.com/octocat/Hello-World/releases/v1.0.0",
"assets_url": "https://api.github.com/repos/octocat/Hello-World/releases/1/assets",
"upload_url": "https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
"tarball_url": "https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0",
"zipball_url": "https://api.github.com/repos/octocat/Hello-World/zipball/v1.0.0",
"discussion_url": "https://github.com/octocat/Hello-World/discussions/90",
"id": 1,
"node_id": "MDc6UmVsZWFzZTE=",
"tag_name": "quil-py/v1.0.0",
"target_commitish": "master",
"name": "v1.0.0",
"body": "Description of the release",
"draft": false,
"prerelease": true,
"created_at": "2013-02-27T19:35:32Z",
"published_at": "2013-02-27T19:35:32Z",
"author": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"assets": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
"browser_download_url": "https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip",
"id": 1,
"node_id": "MDEyOlJlbGVhc2VBc3NldDE=",
"name": "example.zip",
"label": "short description",
"state": "uploaded",
"content_type": "application/zip",
"size": 1024,
"download_count": 42,
"created_at": "2013-02-27T19:35:32Z",
"updated_at": "2013-02-27T19:35:32Z",
"uploader": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
}
]
}
}
78 changes: 78 additions & 0 deletions .github/test_events/python_release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"action": "published",
"release": {
"url": "https://api.github.com/repos/octocat/Hello-World/releases/1",
"html_url": "https://github.com/octocat/Hello-World/releases/v1.0.0",
"assets_url": "https://api.github.com/repos/octocat/Hello-World/releases/1/assets",
"upload_url": "https://uploads.github.com/repos/octocat/Hello-World/releases/1/assets{?name,label}",
"tarball_url": "https://api.github.com/repos/octocat/Hello-World/tarball/v1.0.0",
"zipball_url": "https://api.github.com/repos/octocat/Hello-World/zipball/v1.0.0",
"discussion_url": "https://github.com/octocat/Hello-World/discussions/90",
"id": 1,
"node_id": "MDc6UmVsZWFzZTE=",
"tag_name": "quil-py/v1.0.0",
"target_commitish": "master",
"name": "v1.0.0",
"body": "Description of the release",
"draft": false,
"prerelease": false,
"created_at": "2013-02-27T19:35:32Z",
"published_at": "2013-02-27T19:35:32Z",
"author": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
},
"assets": [
{
"url": "https://api.github.com/repos/octocat/Hello-World/releases/assets/1",
"browser_download_url": "https://github.com/octocat/Hello-World/releases/download/v1.0.0/example.zip",
"id": 1,
"node_id": "MDEyOlJlbGVhc2VBc3NldDE=",
"name": "example.zip",
"label": "short description",
"state": "uploaded",
"content_type": "application/zip",
"size": 1024,
"download_count": 42,
"created_at": "2013-02-27T19:35:32Z",
"updated_at": "2013-02-27T19:35:32Z",
"uploader": {
"login": "octocat",
"id": 1,
"node_id": "MDQ6VXNlcjE=",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}
}
]
}
}
11 changes: 9 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ jobs:
- stable

steps:
# Some of the snapshots have long file paths, so we need to enable long file paths on Windows where the limit is 260 by default
- name: Allow Long File Paths
if: matrix.os == 'windows-latest'
run: |
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
# https://github.com/actions/checkout/issues/1285#issuecomment-2042579471
git config --system core.longpaths true
- name: Checkout sources
uses: actions/checkout@v2
with:
Expand All @@ -41,12 +48,12 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: bench
args: --bench parser -- --warm-up-time=2 --measurement-time=3 --sample-size=500 --color=always
args: --bench parser --bench simplification -- --warm-up-time=2 --measurement-time=3 --sample-size=500 --color=always

- name: Archive benchmark results
if: ${{ github.ref == 'refs/heads/main'}}
uses: actions/upload-artifact@v3
with:
name: benchmarks-${{ matrix.os }}
path: target/criterion


19 changes: 18 additions & 1 deletion .github/workflows/msrv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ jobs:
command: test
args: --all-features

check-py:
name: Check quil-py
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: davidB/rust-cargo-make@v1
- uses: actions/checkout@v1
- uses: snok/install-poetry@v1
- name: Run quil-py tests, lints, and formatting checks.
run: cargo make --cwd quil-py

fmt:
name: Rustfmt
runs-on: ubuntu-latest
Expand Down Expand Up @@ -103,7 +120,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
args: --all-targets --all-features -- -D warnings

deny:
name: Deny
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/prepare-release.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish quil-py documentation

on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- closed

jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install poetry
uses: snok/install-poetry@v1
- uses: Swatinem/rust-cache@v2
- name: Install cargo-make
uses: actions-rs/cargo@v1
with:
command: install
args: --debug cargo-make
- name: Build quil-py documentation
uses: actions-rs/cargo@v1
with:
command: make
args: --cwd quil-py --makefile Makefile.toml docs
- name: Deploy preview
if: ${{ github.event_name == 'pull_request' }}
uses: rossjrw/pr-preview-action@v1
with:
source-dir: quil-py/build/docs
preview-branch: quil-py-docs
- name: Deploy docs
if: ${{ github.event_name == 'push' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: quil-py/build/docs
publish_branch: quil-py-docs
Loading

0 comments on commit d5b2739

Please sign in to comment.