Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Adds basic CI yaml for GitHub Actions #10212

Merged
merged 5 commits into from
Dec 20, 2021
Merged
Changes from 2 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
36 changes: 36 additions & 0 deletions src/doc/src/guide/continuous-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,42 @@ will not fail your overall build. Please see the [Travis CI Rust
documentation](https://docs.travis-ci.com/user/languages/rust/) for more
information.

### GitHub Actions

To test your package on GitHub Actions, here is a sample `.github/workflows/ci.yml` file:

```yaml
name: Cargo Build & Test

on:
push:
SamMorrowDrums marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build_and_test:
name: Rust project - latest
runs-on: ${{ matrix.operating-system }}
continue-on-error: true
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
operating-system:
- "ubuntu-latest"
SamMorrowDrums marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
SamMorrowDrums marked this conversation as resolved.
Show resolved Hide resolved
with:
toolchain: ${{ matrix.toolchain }}
SamMorrowDrums marked this conversation as resolved.
Show resolved Hide resolved
override: true
- run: cargo build --verbose
- run: cargo test --verbose
```

This will test all three release channels, see [actions-rs documentation](https://github.com/actions-rs/cargo) and [GitHub Actions documentation](https://docs.github.com/en/actions) for more information.

### GitLab CI

To test your package on GitLab CI, here is a sample `.gitlab-ci.yml` file:
Expand Down