summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/.github
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
commit10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 (patch)
treebdffd5d80c26cf4a7a518281a204be1ace85b4c1 /src/tools/cargo/.github
parentReleasing progress-linux version 1.70.0+dfsg1-9~progress7.99u1. (diff)
downloadrustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.tar.xz
rustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.zip
Merging upstream version 1.70.0+dfsg2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/cargo/.github')
-rw-r--r--src/tools/cargo/.github/ISSUE_TEMPLATE/bug_report.yml43
-rw-r--r--src/tools/cargo/.github/ISSUE_TEMPLATE/config.yml10
-rw-r--r--src/tools/cargo/.github/ISSUE_TEMPLATE/feature_request.yml35
-rw-r--r--src/tools/cargo/.github/ISSUE_TEMPLATE/tracking_issue.yml50
-rw-r--r--src/tools/cargo/.github/PULL_REQUEST_TEMPLATE.md43
-rw-r--r--src/tools/cargo/.github/workflows/audit.yml30
-rw-r--r--src/tools/cargo/.github/workflows/contrib.yml38
-rw-r--r--src/tools/cargo/.github/workflows/main.yml222
8 files changed, 471 insertions, 0 deletions
diff --git a/src/tools/cargo/.github/ISSUE_TEMPLATE/bug_report.yml b/src/tools/cargo/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 000000000..f465e1240
--- /dev/null
+++ b/src/tools/cargo/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,43 @@
+name: Bug Report
+description: Create a report to help us improve
+labels: ["C-bug"]
+body:
+ - type: markdown
+ attributes:
+ value: Thanks for filing a 🐛 bug report 😄!
+ - type: textarea
+ id: problem
+ attributes:
+ label: Problem
+ description: >
+ Please provide a clear and concise description of what the bug is,
+ including what currently happens and what you expected to happen.
+ validations:
+ required: true
+ - type: textarea
+ id: steps
+ attributes:
+ label: Steps
+ description: Please list the steps to reproduce the bug.
+ placeholder: |
+ 1.
+ 2.
+ 3.
+ - type: textarea
+ id: possible-solutions
+ attributes:
+ label: Possible Solution(s)
+ description: >
+ Not obligatory, but suggest a fix/reason for the bug,
+ or ideas how to implement the addition or change.
+ - type: textarea
+ id: notes
+ attributes:
+ label: Notes
+ description: Provide any additional notes that might be helpful.
+ - type: textarea
+ id: version
+ attributes:
+ label: Version
+ description: Please paste the output of running `cargo version --verbose`.
+ render: text
diff --git a/src/tools/cargo/.github/ISSUE_TEMPLATE/config.yml b/src/tools/cargo/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 000000000..ed4289847
--- /dev/null
+++ b/src/tools/cargo/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,10 @@
+contact_links:
+ - name: Question
+ url: https://users.rust-lang.org
+ about: >
+ Got a question about Cargo? Ask the community on the user forum.
+ - name: Inspiring Idea
+ url: https://internals.rust-lang.org/c/tools-and-infrastructure/cargo
+ about: >
+ Need more discussions with your next big idea?
+ Reach out the coummunity on the internals forum.
diff --git a/src/tools/cargo/.github/ISSUE_TEMPLATE/feature_request.yml b/src/tools/cargo/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 000000000..bae2469d1
--- /dev/null
+++ b/src/tools/cargo/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,35 @@
+name: Feature Request
+description: Suggest an idea for enhancing Cargo
+labels: ["C-feature-request"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for filing a 🙋 feature request 😄!
+
+ If the feature request is relatively small and already with a possible solution, this might be the place for you.
+
+ If you are brewing a big feature that needs feedback from the community, [the internal forum] is the best fit, especially for pre-RFC. You can also talk the idea over with other developers in [#t-cargo Zulip stream].
+
+ [the internal forum]: https://internals.rust-lang.org/c/tools-and-infrastructure/cargo/15
+ [#t-cargo Zulip stream]: https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo
+ - type: textarea
+ id: problem
+ attributes:
+ label: Problem
+ description: >
+ Please provide a clear description of your use case and the problem
+ this feature request is trying to solve.
+ validations:
+ required: true
+ - type: textarea
+ id: solution
+ attributes:
+ label: Proposed Solution
+ description: >
+ Please provide a clear and concise description of what you want to happen.
+ - type: textarea
+ id: notes
+ attributes:
+ label: Notes
+ description: Provide any additional context or information that might be helpful.
diff --git a/src/tools/cargo/.github/ISSUE_TEMPLATE/tracking_issue.yml b/src/tools/cargo/.github/ISSUE_TEMPLATE/tracking_issue.yml
new file mode 100644
index 000000000..d687db4e5
--- /dev/null
+++ b/src/tools/cargo/.github/ISSUE_TEMPLATE/tracking_issue.yml
@@ -0,0 +1,50 @@
+name: Tracking Issue
+description: A tracking issue for an accepted feature or RFC in Cargo.
+title: "Tracking Issue for _FEATURE_NAME_"
+labels: ["C-tracking-issue"]
+body:
+ - type: markdown
+ attributes:
+ value: >
+ Thank you for creating a tracking issue! Tracking issues are for tracking an
+ accepted feature or RFC from implementation to stabilization. Please do not
+ file a tracking issue until the feature or RFC has been approved.
+ - type: textarea
+ id: summary
+ attributes:
+ label: Summary
+ description: Please provide a very brief summary of the feature.
+ value: |
+ RFC: [#NNNN](https://github.com/rust-lang/rfcs/pull/NNNN) <!-- If this is an RFC -->
+ Original issue: #NNNN <!-- if there is a related issue that spawned this feature -->
+ Implementation: #NNNN <!-- link to the PR that implemented this feature if applicable -->
+ Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#my-feature
+
+ Please enter a short, one-sentence description here.
+ validations:
+ required: true
+ - type: textarea
+ id: unresolved
+ attributes:
+ label: Unresolved Issues
+ description: List issues that have not yet been resolved.
+ placeholder: |
+ * [ ] Make a list of any known implementation or design issues.
+ - type: textarea
+ id: future
+ attributes:
+ label: Future Extensions
+ description: >
+ An optional section where you can mention where the feature may be
+ extended in the future, but is explicitly not intended to
+ address.
+ - type: textarea
+ id: about
+ attributes:
+ label: About tracking issues
+ description: Please include this notice in the issue.
+ value: |
+ Tracking issues are used to record the overall progress of implementation.
+ They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
+ A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
+ Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
diff --git a/src/tools/cargo/.github/PULL_REQUEST_TEMPLATE.md b/src/tools/cargo/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 000000000..141ac5ed4
--- /dev/null
+++ b/src/tools/cargo/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,43 @@
+<!-- homu-ignore:start -->
+<!--
+NOTICE: Due to limited review capacity, the Cargo team is not accepting new
+features or major changes at this time. Please consult with the team before
+opening a new PR. Only issues that have been explicitly marked as accepted
+will be reviewed.
+
+Thanks for submitting a pull request 🎉! Here are some tips for you:
+
+* If this is your first contribution, read "Cargo Contribution Guide":
+ https://doc.crates.io/contrib/
+* Run `cargo fmt --all` to format your code changes.
+* Small commits and pull requests are always preferable and easy to review.
+* If your idea is large and needs feedback from the community, read how:
+ https://doc.crates.io/contrib/process/#working-on-large-features
+* Cargo takes care of compatibility. Read our design principles:
+ https://doc.crates.io/contrib/design.html
+* When changing help text of cargo commands, follow the steps to generate docs:
+ https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
+* If your PR is not finished, set it as "draft" PR or add "WIP" in its title.
+* It's ok to use the CI resources to test your PR, but please don't abuse them.
+
+### What does this PR try to resolve?
+
+Explain the motivation behind this change.
+A clear overview along with an in-depth explanation are helpful.
+
+You can use `Fixes #<issue number>` to associate this PR to an existing issue.
+
+### How should we test and review this PR?
+
+Demonstrate how you test this change and guide reviewers through your PR.
+With a smooth review process, a pull request usually gets reviewed quicker.
+
+If you don't know how to write and run your tests, please read the guide:
+https://doc.crates.io/contrib/tests
+
+### Additional information
+
+Other information you want to mention in this PR, such as prior arts,
+future extensions, an unresolved problem, or a TODO list.
+-->
+<!-- homu-ignore:end -->
diff --git a/src/tools/cargo/.github/workflows/audit.yml b/src/tools/cargo/.github/workflows/audit.yml
new file mode 100644
index 000000000..14e35b7b3
--- /dev/null
+++ b/src/tools/cargo/.github/workflows/audit.yml
@@ -0,0 +1,30 @@
+name: Security audit
+
+permissions:
+ contents: read
+
+on:
+ pull_request:
+ paths:
+ - '**/Cargo.toml'
+ - '**/Cargo.lock'
+ push:
+ branches:
+ - master
+
+jobs:
+ cargo_deny:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ checks:
+ - advisories
+ - bans licenses sources
+ steps:
+ - uses: actions/checkout@v3
+ - uses: EmbarkStudios/cargo-deny-action@v1
+ # Prevent sudden announcement of a new advisory from failing ci:
+ continue-on-error: ${{ matrix.checks == 'advisories' }}
+ with:
+ command: check ${{ matrix.checks }}
+ rust-version: stable
diff --git a/src/tools/cargo/.github/workflows/contrib.yml b/src/tools/cargo/.github/workflows/contrib.yml
new file mode 100644
index 000000000..bbd4a7ef7
--- /dev/null
+++ b/src/tools/cargo/.github/workflows/contrib.yml
@@ -0,0 +1,38 @@
+name: Contrib Deploy
+on:
+ push:
+ branches:
+ - master
+
+permissions:
+ contents: read
+
+jobs:
+ deploy:
+ permissions:
+ contents: write # for Git to git push
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ - name: Install mdbook
+ run: |
+ mkdir mdbook
+ curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
+ echo `pwd`/mdbook >> $GITHUB_PATH
+ - name: Deploy docs
+ run: |
+ cd src/doc/contrib
+ mdbook build
+ git worktree add gh-pages gh-pages
+ git config user.name "Deploy from CI"
+ git config user.email ""
+ cd gh-pages
+ # Delete the ref to avoid keeping history.
+ git update-ref -d refs/heads/gh-pages
+ rm -rf contrib
+ mv ../book contrib
+ git add contrib
+ git commit -m "Deploy $GITHUB_SHA to gh-pages"
+ git push --force
diff --git a/src/tools/cargo/.github/workflows/main.yml b/src/tools/cargo/.github/workflows/main.yml
new file mode 100644
index 000000000..400e725e5
--- /dev/null
+++ b/src/tools/cargo/.github/workflows/main.yml
@@ -0,0 +1,222 @@
+name: CI
+on:
+ push:
+ branches-ignore: [master]
+ pull_request:
+ branches: ['*']
+
+defaults:
+ run:
+ shell: bash
+
+permissions:
+ contents: read
+
+env:
+ CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
+
+jobs:
+ # Check Code style quickly by running `rustfmt` over all code
+ rustfmt:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - run: rustup update stable && rustup default stable
+ - run: rustup component add rustfmt
+ - run: cargo fmt --all --check
+ - run: |
+ for manifest in `find crates benches/benchsuite benches/capture -name Cargo.toml`
+ do
+ echo check fmt for $manifest
+ cargo fmt --all --manifest-path $manifest --check
+ done
+
+ # Ensure there are no clippy warnings
+ clippy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - run: rustup update stable && rustup default stable
+ - run: rustup component add clippy
+ # Only check cargo lib for now
+ - run: cargo clippy -p cargo --lib -- -D warnings
+
+ test:
+ runs-on: ${{ matrix.os }}
+ env:
+ CARGO_PROFILE_DEV_DEBUG: 1
+ CARGO_PROFILE_TEST_DEBUG: 1
+ CARGO_INCREMENTAL: 0
+ CARGO_PUBLIC_NETWORK_TESTS: 1
+ # Deny warnings on CI to avoid warnings getting into the codebase.
+ RUSTFLAGS: -D warnings
+ strategy:
+ matrix:
+ include:
+ - name: Linux x86_64 stable
+ os: ubuntu-latest
+ rust: stable
+ other: i686-unknown-linux-gnu
+ - name: Linux x86_64 beta
+ os: ubuntu-latest
+ rust: beta
+ other: i686-unknown-linux-gnu
+ - name: Linux x86_64 nightly
+ os: ubuntu-latest
+ rust: nightly
+ other: i686-unknown-linux-gnu
+ - name: macOS x86_64 stable
+ os: macos-latest
+ rust: stable
+ other: x86_64-apple-ios
+ - name: macOS x86_64 nightly
+ os: macos-latest
+ rust: nightly
+ other: x86_64-apple-ios
+ - name: Windows x86_64 MSVC stable
+ os: windows-latest
+ rust: stable-msvc
+ other: i686-pc-windows-msvc
+ - name: Windows x86_64 gnu nightly # runs out of space while trying to link the test suite
+ os: windows-latest
+ rust: nightly-gnu
+ other: i686-pc-windows-gnu
+ name: Tests ${{ matrix.name }}
+ steps:
+ - uses: actions/checkout@v3
+ - name: Dump Environment
+ run: ci/dump-environment.sh
+ - name: Update Rustup (temporary workaround)
+ run: rustup self update
+ shell: bash
+ if: startsWith(matrix.os, 'windows')
+ - run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
+ - run: rustup target add ${{ matrix.other }}
+ - run: rustup component add rustc-dev llvm-tools-preview rust-docs
+ if: startsWith(matrix.rust, 'nightly')
+ - run: sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y
+ if: matrix.os == 'ubuntu-latest'
+ - run: rustup component add rustfmt || echo "rustfmt not available"
+ - name: Configure extra test environment
+ run: echo CARGO_CONTAINER_TESTS=1 >> $GITHUB_ENV
+ if: matrix.os == 'ubuntu-latest'
+
+ - run: cargo test
+ - name: Clear intermediate test output
+ run: ci/clean-test-output.sh
+ - name: gitoxide tests (all git-related tests)
+ run: cargo test git
+ env:
+ __CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2: 1
+ # The testsuite generates a huge amount of data, and fetch-smoke-test was
+ # running out of disk space.
+ - name: Clear test output
+ run: ci/clean-test-output.sh
+ - name: Check operability of rustc invocation with argfile
+ env:
+ __CARGO_TEST_FORCE_ARGFILE: 1
+ run: |
+ # This only tests `cargo fix` because fix-proxy-mode is one of the most
+ # complicated subprocess management in Cargo.
+ cargo test --test testsuite -- fix::
+ - run: cargo test --manifest-path crates/cargo-test-support/Cargo.toml
+ env:
+ CARGO_TARGET_DIR: target
+ - run: cargo test -p cargo-platform
+ - run: cargo test -p cargo-util
+ - run: cargo test --manifest-path crates/home/Cargo.toml
+ - run: cargo test --manifest-path crates/mdman/Cargo.toml
+ - run: cargo build --manifest-path crates/credential/cargo-credential-1password/Cargo.toml
+ - run: cargo build --manifest-path crates/credential/cargo-credential-gnome-secret/Cargo.toml
+ if: matrix.os == 'ubuntu-latest'
+ - run: cargo build --manifest-path crates/credential/cargo-credential-macos-keychain/Cargo.toml
+ if: matrix.os == 'macos-latest'
+ - run: cargo build --manifest-path crates/credential/cargo-credential-wincred/Cargo.toml
+ if: matrix.os == 'windows-latest'
+ - name: Check benchmarks
+ env:
+ # Share the target dir to try to cache a few build-time deps.
+ CARGO_TARGET_DIR: target
+ run: |
+ # This only tests one benchmark since it can take over 10 minutes to
+ # download all workspaces.
+ cargo test --manifest-path benches/benchsuite/Cargo.toml --all-targets -- cargo
+ cargo check --manifest-path benches/capture/Cargo.toml
+ # The testsuite generates a huge amount of data, and fetch-smoke-test was
+ # running out of disk space.
+ - name: Clear benchmark output
+ run: ci/clean-test-output.sh
+ - name: Fetch smoke test
+ run: ci/fetch-smoke-test.sh
+
+ resolver:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - run: rustup update stable && rustup default stable
+ - run: cargo test --manifest-path crates/resolver-tests/Cargo.toml
+
+ test_gitoxide:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - run: rustup update --no-self-update stable && rustup default stable
+ - run: rustup target add i686-unknown-linux-gnu
+ - run: sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y
+ - run: rustup component add rustfmt || echo "rustfmt not available"
+ - run: cargo test
+ env:
+ __CARGO_USE_GITOXIDE_INSTEAD_OF_GIT2: 1
+
+ build_std:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - run: rustup update nightly && rustup default nightly
+ - run: rustup component add rust-src
+ - run: cargo build
+ - run: cargo test --test build-std
+ env:
+ CARGO_RUN_BUILD_STD_TESTS: 1
+ docs:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - run: rustup update nightly && rustup default nightly
+ - run: rustup update stable
+ - run: rustup component add rust-docs
+ - run: ci/validate-man.sh
+ # This requires rustfmt, use stable.
+ - run: cd src/doc/semver-check && cargo +stable run
+ - run: |
+ mkdir mdbook
+ curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.27/mdbook-v0.4.27-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
+ echo `pwd`/mdbook >> $GITHUB_PATH
+ - run: cargo doc --document-private-items --no-deps
+ env:
+ RUSTDOCFLAGS: -D warnings
+ - run: cd src/doc && mdbook build --dest-dir ../../target/doc
+ - run: |
+ cd src/doc
+ curl -sSLo linkcheck.sh \
+ https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
+ sh linkcheck.sh --all cargo
+
+ success:
+ permissions:
+ contents: none
+ name: bors build finished
+ needs: [docs, rustfmt, test, resolver, build_std, test_gitoxide]
+ runs-on: ubuntu-latest
+ if: "success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'"
+ steps:
+ - run: echo ok
+ failure:
+ permissions:
+ contents: none
+ name: bors build finished
+ needs: [docs, rustfmt, test, resolver, build_std]
+ runs-on: ubuntu-latest
+ if: "!success() && github.event_name == 'push' && github.ref == 'refs/heads/auto-cargo'"
+ steps:
+ - run: exit 1