Commit Graph

151 Commits

Author SHA1 Message Date
Charlie Marsh 4634560c80
Ensure release tagging has access to repo clone (#5240)
## Summary

The [release
failed](https://github.com/astral-sh/ruff/actions/runs/5329733171/jobs/9656004063),
but late enough that I was able to do the remaining steps manually. The
issue here is that the tagging step requires that we clone the repo. I
split the upload (to PyPI), tagging (in Git), and publishing (to GitHub
Releases) phases into their own steps, since they need different
resources + permissions anyway.
2023-06-21 10:24:33 -04:00
Charlie Marsh a332f078db
Checkout repo to support release tag validation (#5238)
## Summary

The
[release](https://github.com/astral-sh/ruff/actions/runs/5329340068/jobs/9655224008)
failed due to an inability to find `pyproject.toml`. This PR moves that
validation into its own step (so we can fail fast) and ensures we clone
the repo.
2023-06-21 03:16:35 +00:00
konstin b4bd5a5acb
Make the release workflow more resilient (#4728)
## Summary

Currently, it is possible to create a tag and then have the release
fail, which is a problem since we can't edit the tag
(https://github.com/charliermarsh/ruff/issues/4468). This change the
release process so that the tag is created inside the release workflow.
This leaves as a failure mode that we have published to pypi but then
creating the tag or GitHub release doesn't work, but in this case we can
restart and the pypi upload is just skipped because we use the skip
existing option.

The release workflow is started by a workflow dispatch with the tag
instead of creating the tag yourself. You can start the release workflow
without a tag to do a dry run which does not publish an artifacts. You
can optionally add a git sha to the workflow run and it will verify that
the release runs on the mentioned commit.

This also adds docs on how to release and a small style improvement for
the maturin integration.

## Test Plan

Testing is hard since we can't do real releases, i've tested a minimized
workflow in a separate dummy repository.
2023-06-20 18:33:09 +00:00
Thomas de Zeeuw 17f1ecd56e
Open cache files in parallel (#5120)
## Summary

Open cache files in parallel (again), brings the performance back to be roughly equal to the old implementation.

## Test Plan

Existing tests should keep working.
2023-06-20 17:43:09 +02:00
Dhruv Manilawala bf5fbf8971
Add GitHub CODEOWNERS file (#5054)
## Summary

Add GitHub CODEOWNERS file.

Initiating this, we can discuss and iterate further.

https://help.github.com/articles/about-codeowners/

## Test Plan

Look out for review requests :)
2023-06-14 05:21:59 +00:00
konstin 548a3cbb3f
Small CI improvements (#4953)
* Replace the unmaintained actions-rs/cargo that github actions
complains about using an old node version with plain cargo (this was the
original motivation for this PR)
* Use taiki-e/install-action to install critcmp directly
* Use a rust 1.70 nightly toolchain for udeps
* Cache python package build (this should cut a good chunk of ci time)
* yaml formatting courtesy of pycharm

Test Plan: CI itself
2023-06-09 09:03:34 +02:00
Dhruv Manilawala 07cc4bcb0f
Update links to point to Astral org (#4949) 2023-06-08 11:43:40 -04:00
konstin 5c48414093
Use taiki-e/install-action to install cargo fuzz (#4928)
* Use taiki-e/install-action to install cargo fuzz

The cargo fuzz run seems to sometimes fail for unclear reasons (https://github.com/charliermarsh/ruff/actions/runs/5200348677/jobs/9379742606?pr=4900). I hope that this might fix it. I'll push more commits to this PR to check the caching behaviour.

* Trigger CI with cache

* Change cache

* Actually use caching

* Undo cargo update

* cargo update fuzzer

* Revert rust changes
2023-06-07 15:57:33 +00:00
Addison Crump 2f125f4019
Create fuzzers for testing correctness of parsing, linting and fixing (#4822)
Co-authored-by: Micha Reiser <micha@reiser.io>
2023-06-07 14:57:07 +02:00
Charlie Marsh 222ca98a41
Add `contents: write` permission to release step (#4911) 2023-06-07 08:42:27 -04:00
Charlie Marsh e1df2b1400
Set default Rust version when testing sdist (#4908) 2023-06-06 16:59:04 -04:00
Charlie Marsh 3ff1f003f4
Omit internal and documentation changes from changelog (#4814) 2023-06-02 15:39:37 +00:00
konstin 12e45498e8
Improve token handling (#4653)
* Use release environment

* Use pypi trusted publishing

* typo
2023-05-26 09:52:24 +02:00
Charlie Marsh 252506f8ed
Remove deprecated --universal2 flag (#4640) 2023-05-24 17:00:52 +00:00
Charlie Marsh f4f1b1d0ee
Only run the playground release job on release (#4636) 2023-05-24 11:48:36 -04:00
Evan Rittenhouse b1d01b1950
Add a PR template (#4582) 2023-05-24 02:17:38 +00:00
konstin 3cbaaa4795
Refactor and fix task trigger for dependent jobs in other repos (#4598)
* Refactor and fix task trigger for dependent jobs in other repos

I have confirmed (https://github.com/konstin/ruff-pre-commit/actions/runs/5056928280/jobs/9075029868) that this does dispatch the workflow when running with act, `owner: 'konstin'`, `needs` commented out and personal access token. I can't properly test the actual release workflow, and i'm unsure how to best handle the next release after this was merged (should we do a beta release or will this break everything that assumes we only do stable releases?)

The command for act is
```
act -j update-dependents -s RUFF_PRE_COMMIT_PAT=<...>
```

* delete old file
2023-05-23 20:55:35 +02:00
Charlie Marsh f22c269ccf
Point LSP, VS Code, and pre-commut URLs to Astral org (#4562) 2023-05-21 15:27:35 -04:00
Micha Reiser 2f35099f81
Remove `regex` dependency from `ruff_python_ast` (#4518) 2023-05-19 06:44:18 +00:00
konstin a3aa841fc9
Overhaul sdist handling (#4439)
* Reduce sdist size

`maturin sdist && du -sh target/wheels/ruff-0.0.267.tar.gz`:
Before: 1,1M
After: 668K

* Test sdist before release

* Update maturin to fix the sdist
2023-05-18 19:02:22 +02:00
Charlie Marsh 8f3f8d3e0b
Revert change to re-run release on tag update (#4441) 2023-05-15 15:48:45 +00:00
Zanie Adkins f5be3d8e5b
Update CI to test Python wheel on Linux (#4398) 2023-05-12 16:27:18 -04:00
Charlie Marsh 7617519b4f Skip python -m ruff --help on linux-cross 2023-05-12 15:46:42 -04:00
Charlie Marsh bc7ddd8f3a Temporarily create release on-tag 2023-05-12 15:31:48 -04:00
Zanie Adkins ebda9b31d9
Update CI to test `python -m ruff` on release (#4397) 2023-05-12 18:47:30 +00:00
Calum Young cd41de2588
Check docs formatting check (#4270) 2023-05-08 19:03:22 +00:00
Micha Reiser edaf891042
Fix jemalloc page size on aarch64 (#4247)
Co-authored-by: konstin <konstin@mailbox.org>
2023-05-08 08:10:03 +02:00
Calum Young f0f4bf2929
Move typos to pre-commit config (#4148) 2023-04-29 12:13:35 -04:00
Calum Young ab65eaea7f
Add docs build validation stage to CI (#4116)
Nice. Thank you
2023-04-26 14:57:59 +01:00
konstin 19d8913e32
Use musl in ecosystem docker (#3998)
This prevents errors when the host glibc is newer than the one in the docker container
2023-04-26 05:54:53 +02:00
Jonathan Plasse f3f9a9f297
Fix pre-commit CI job exit code (#3833) 2023-03-31 14:47:04 -04:00
konstin 13e52b1f76
Use cache in cargo udeps CI (#3809) 2023-03-31 11:07:14 -04:00
Jonathan Plasse fec4fa39a7
Improve `add_rule.py` and `add_plugin.py` scripts (#3725) 2023-03-25 16:05:39 +00:00
Jonathan Plasse b8ae1e0e05
Add `pre-commit` in CI (#3707) 2023-03-24 17:20:13 -04:00
Jonathan Plasse 3ec1ea8ac2
Add cargo-udeps in CI (#3646) 2023-03-22 15:53:12 +01:00
Jonathan Plasse c42f8b93d2
Add Swatinem/rust-cache to benchmark-compare job (#3637) 2023-03-21 14:45:09 +01:00
Micha Reiser 404504ab41
CI Checks: Fix malformed markdown (#3595)
The Benchmark results aren't formatted properly if the ecosystem check finds differences because the ecosystem check doesn't emit a trailing newline.

This PR adds the trailing newline to the ecosystem check script.
2023-03-18 10:04:50 +00:00
Micha Reiser aa51ecedc5
ci: Benchmark CI Step (#3480) 2023-03-16 09:05:10 +01:00
Micha Reiser de1106b95a
Allow dispatching the PR comment job for testing (#3535) 2023-03-15 09:34:53 +01:00
Xuehai Pan 8c7317eb8d
ci: fix missing short tag for cloudflare/wrangler-action (#3513) 2023-03-14 15:16:09 +00:00
Xuehai Pan 78c2b0ac47
ci: add dependabot integration for GitHub Actions (#3504) 2023-03-14 10:31:26 -04:00
Samuel Cormier-Iijima 3a7bdb39c9
Fix base ref determination for artifact download in ecosystem CI check (#3499) 2023-03-13 22:37:12 -04:00
Samuel Cormier-Iijima cfa2924664
Setup ecosystem CI (#3390)
This PR sets up an "ecosystem" check as an optional part of the CI step for pull requests. The primary piece of this is a new script in `scripts/check_ecosystem.py` which takes two ruff binaries as input and compares their outputs against a corpus of open-source code in parallel. I used ruff's `text` reporting format and stdlib's `difflib` (rather than JSON output and jsondiffs) to avoid adding another dependency. There is a new ecosystem-comment workflow to add a comment to the PR (see [this link](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) which explains why it needs to be done as a new workflow for security reasons).
2023-03-10 17:39:07 -05:00
Micha Reiser 229f1c34cb
refactor: Extract `ruff_wasm` (#3401) 2023-03-09 10:07:39 +00:00
konstin 22e6778e17
Add `cargo dev generate-all --check` and catch outdated docs in `cargo test` (#3320) 2023-03-06 11:28:38 +01:00
konstin d1288dc2b1
Remove maturin build from CI (#3322)
maturin build generally works when cargo build works, so imho it's not worth running it with every CI run.
2023-03-03 16:50:26 +01:00
Charlie Marsh 187104e396
Flag out-of-date docs on CI (#3309) 2023-03-02 15:55:39 -05:00
messense 08e9d12137
Upload `ruff` binaries to GitHub release (#2930) 2023-02-15 12:07:47 -05:00
messense 028c7855b2
Simplify release workflows (#2913)
* No need to build for PyPy since it only contains a binary so the platform tag is the same as CPython
* Update `maturin-action` location
2023-02-15 08:15:19 -05:00
Martin Fischer 02285c18d1 Remove autogenerated docs/rules/*.md files 2023-02-13 19:34:06 -05:00