Skip to content

Commit bb48cd5

Browse files
Adds basic CI yaml for GitHub Actions
1 parent fcef612 commit bb48cd5

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

src/doc/src/guide/continuous-integration.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,41 @@ will not fail your overall build. Please see the [Travis CI Rust
2121
documentation](https://docs.travis-ci.com/user/languages/rust/) for more
2222
information.
2323
24+
### GitHub Actions
25+
26+
To test your package on GitHub Actions, here is a sample `.github/workflows/ci.yml` file:
27+
28+
```yaml
29+
name: Cargo Build & Test
30+
31+
on:
32+
push:
33+
34+
jobs:
35+
build_and_test:
36+
name: Rust project - latest
37+
runs-on: ${{ matrix.operating-system }}
38+
continue-on-error: true
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
toolchain:
43+
- stable
44+
- beta
45+
- nightly
46+
operating-system:
47+
- "ubuntu-latest"
48+
steps:
49+
- uses: actions/checkout@v2
50+
- uses: actions-rs/toolchain@v1
51+
with:
52+
toolchain: ${{ matrix.toolchain }}
53+
- run: cargo build --verbose
54+
- run: cargo test --verbose
55+
```
56+
57+
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.
58+
2459
### GitLab CI
2560

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

0 commit comments

Comments
 (0)