https://github.com/qroc/cargo-actions
Integration Rust Cargo with GitHub Actions
https://github.com/qroc/cargo-actions
cargo github github-actions infrastructure rust
Last synced: about 1 month ago
JSON representation
Integration Rust Cargo with GitHub Actions
- Host: GitHub
- URL: https://github.com/qroc/cargo-actions
- Owner: qRoC
- License: mit
- Created: 2021-04-11T21:48:12.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-19T00:30:49.000Z (7 months ago)
- Last Synced: 2025-05-14T21:17:36.546Z (about 1 month ago)
- Topics: cargo, github, github-actions, infrastructure, rust
- Language: TypeScript
- Homepage:
- Size: 1.15 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## Integration Rust Cargo with GitHub Actions
### Overview
General result
![]()
Error in code
![]()
Failed test
![]()
### Inputs
- **Required** `command`: Cargo command like `build`, `check`, `test`, etc.
- `args`: Arguments for the cargo command.
- `manifest-path`: Path to the Cargo.toml. By default, is the working directory.
- `token`: GitHub token. Used for enable more powerful annotation system. *Strongly recommended**
- `toolchain`: Toolchain to use. For example: `nightly`._* Default GitHub Actions annotations supports only up to 10 warnings and 10 errors for per the step. With `token` you up this limit to `1000`_
### Outputs
- `notice_count`: Notice count.
- `warning_count`: Warning count.
- `failure_count`: Failure count.### Example
```yaml
# if `with.token` is used
permissions:
checks: writejobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2- uses: qRoC/cargo-actions@v1
with:
command: build
args: --verbose
token: ${{ secrets.GITHUB_TOKEN }}code_style:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2- uses: qRoC/cargo-actions@v1
with:
command: fmt
toolchain: nightly
args: --all -- --check
token: ${{ secrets.GITHUB_TOKEN }}lint:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2- uses: qRoC/cargo-actions@v1
with:
command: clippy
args: --all-features --all-targets -- -D warnings
token: ${{ secrets.GITHUB_TOKEN }}tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2- uses: qRoC/cargo-actions@v1
with:
command: test
args: --all-features --no-fail-fast --jobs 1
token: ${{ secrets.GITHUB_TOKEN }}audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2- uses: qRoC/cargo-actions@v1
with:
command: audit
```### For developers
1. Install the dependencies.
```shell
$ yarn install
```2. Do some changes.
3. Build the typescript and package it for distribution.
```shell
$ yarn build && yarn package
```3. Run the tests.
```shell
$ yarn test
```4. Publish changes.
```shell
$ git add -A
$ git commit -m "..."
$ git push origin main
```5. Move distribution tag.
```shell
git tag -fa v1 -m "Update v1 tag"
git push origin main --force
```