Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/doc/src/guide/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,40 @@ breakage in nightly will not fail your overall build. Please see the
[GitLab CI](https://docs.gitlab.com/ce/ci/yaml/README.html) for more
information.

### GitHub Actions

To test your package on GitHub Actions, here is a sample `workflow.yml` file, which has to be in the directory `.github/workflows`:
```yaml
name: Rust

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
```
This will run on a push to the repository. Pleas see the [GitHub Actions help](https://help.github.com/en/actions) for more information.

### builds.sr.ht

To test your package on sr.ht, here is a sample `.build.yml` file.
Expand Down
52 changes: 2 additions & 50 deletions src/doc/src/reference/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,59 +433,11 @@ default-run = "a"

### The `[badges]` section

[crates.io] can display various badges for build status, test coverage, etc. for
each crate. All badges are optional.

- The badges pertaining to build status that are currently available are
Appveyor, CircleCI, Cirrus CI, GitLab, Azure DevOps, Travis CI and Bitbucket
Pipelines.
- Available badges pertaining to code test coverage are Codecov and Coveralls.
- There are also maintenance-related badges based on isitmaintained.com
which state the issue resolution time, percent of open issues, and future
maintenance intentions.

Most badge specifications require a `repository` key. It is expected to be in
`user/repo` format.
[crates.io] does not display various badges for build status, test coverage, etc. for
each crate any more. Only the following fields will be shown.
Comment on lines +436 to +437
Copy link
Contributor

@ehuss ehuss May 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not start off with what badges don't do. Perhaps start off with a description, such as:

Badges are pieces of status information about a package. They can
be displayed as small images on a package registry website. 

Then follow with a description of the badges that are supported by crates.io. I would keep the description of the maintenance badges, and the link to isitmaintained.com, for example.

Then, at the bottom after the example, include a note for anyone who may be confused as to what changed:

Note: [crates.io] previously displayed badges next to a crate on its
website, but that functionality has been removed. Packages should place
badges in its README file and set the readme field so
that the entire README is displayed on [crates.io].

Also, I'm uncertain, but it looks like crates.io is not showing any badges anymore? What is the state of the maintenance badges? Why would someone set them?

Also, the format for the fields is not explained. What is the form for the repository field? Is it a URL to a website? A git URL?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the maintenance status is moved into the gui maybe the whole section should be removed?


```toml
[badges]

# Appveyor: `repository` is required. `branch` is optional; default is `master`
# `service` is optional; valid values are `github` (default), `bitbucket`, and
# `gitlab`; `id` is optional; you can specify the appveyor project id if you
# want to use that instead. `project_name` is optional; use when the repository
# name differs from the appveyor project name.
appveyor = { repository = "...", branch = "master", service = "github" }

# Circle CI: `repository` is required. `branch` is optional; default is `master`
circle-ci = { repository = "...", branch = "master" }

# Cirrus CI: `repository` is required. `branch` is optional; default is `master`
cirrus-ci = { repository = "...", branch = "master" }

# GitLab: `repository` is required. `branch` is optional; default is `master`
gitlab = { repository = "...", branch = "master" }

# Azure DevOps: `project` is required. `pipeline` is required. `build` is optional; default is `1`
# Note: project = `organization/project`, pipeline = `name_of_pipeline`, build = `definitionId`
azure-devops = { project = "...", pipeline = "...", build="2" }

# Travis CI: `repository` in format "<user>/<project>" is required.
# `branch` is optional; default is `master`
travis-ci = { repository = "...", branch = "master" }

# Bitbucket Pipelines: `repository` is required. `branch` is required
bitbucket-pipelines = { repository = "...", branch = "master" }

# Codecov: `repository` is required. `branch` is optional; default is `master`
# `service` is optional; valid values are `github` (default), `bitbucket`, and
# `gitlab`.
codecov = { repository = "...", branch = "master", service = "github" }

# Coveralls: `repository` is required. `branch` is optional; default is `master`
# `service` is optional; valid values are `github` (default) and `bitbucket`.
coveralls = { repository = "...", branch = "master", service = "github" }

# Is it maintained resolution time: `repository` is required.
is-it-maintained-issue-resolution = { repository = "..." }

Expand Down